inngest-js icon indicating copy to clipboard operation
inngest-js copied to clipboard

[BUG] Inngest not working with hono

Open BernardoSM opened this issue 9 months ago • 5 comments

Describe the bug 3 days ago was merged hono framework for inngest that you can see here.

I tried to run the example and works pretty well, but when I run inngest dev server I'm receiving some errors.

To Reproduce Steps to reproduce the behavior:

  1. Follow Getting started, run app locally and open http://localhost:3000/api/inngest to check if inngest is working
  2. Run npx inngest-cli@latest dev in terminal

Expected behavior Not show any error on terminal that is running hono (cloudflare worker) with inngest. Not show two apps on inngest dev server

Code snippets / Logs / Screenshots

Hono terminal errors:
[wrangler:inf] GET /api/inngest 500 Internal Server Error (2ms)
✘ [ERROR] workerd/server/server.c++:3340: error: Uncaught exception: kj/async-io-unix.c++:569: disconnected: ::read(fd, buffer, maxBytes): Connection reset by peer

  stack:
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@55c6383
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@55c43e5
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@405a071
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40778a0
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40bfeb1
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40835e0
  workerd/server/server.c++:3340: error: Uncaught exception:
  kj/async-io-unix.c++:186: disconnected: ::write(fd, buffer, size):
  Connection reset by peer
  stack:
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@55c508f
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@55c5ba1
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4062df9
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40632f6
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@5583fff
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40be61b
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40bf54b
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40bff82
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40835e0
  workerd/server/server.c++:3135: error: kj::getCaughtExceptionAsKj()
  = kj/async-io-unix.c++:186: disconnected: ::write(fd, buffer,
  size): Connection reset by peer
  stack:
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@55c508f
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@55c5ba1
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@4062df9
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40632f6
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@5583fff
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40bd5ea
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40c0cfd
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@40c0fc4
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@348c0e0
  /home/bernardosm/blindpaylabs2/inngest-hono/node_modules/@cloudflare/workerd-linux-64/bin/workerd@2e0b1a0


[wrangler:inf] GET /x/inngest 404 Not Found (1ms)
[wrangler:inf] GET /.netlify/functions/inngest 404 Not Found (1ms)
[wrangler:inf] GET /.redwood/functions/inngest 404 Not Found (1ms)
[wrangler:inf] PUT /api/inngest 200 OK (4ms)
[wrangler:inf] PUT /api/inngest 200 OK (4ms)
[wrangler:inf] PUT /api/inngest 500 Internal Server Error (2ms)
✘ [ERROR] [Inngest] error - TypeError: Failed calling `url` from serve handler when starting to handle request; Invalid URL string.

      at url
  (file:///home/bernardosm/blindpaylabs2/inngest-hono/node_modules/src/hono.ts:38:20)
      at fn
  (file:///home/bernardosm/blindpaylabs2/inngest-hono/node_modules/src/components/InngestCommHandler.ts:529:16)
      at async InngestCommHandler.handleAction
  (file:///home/bernardosm/blindpaylabs2/inngest-hono/node_modules/src/components/InngestCommHandler.ts:700:19)
      at async ServerTiming.wrap
  (file:///home/bernardosm/blindpaylabs2/inngest-hono/node_modules/src/helpers/ServerTiming.ts:83:15)
      at async ServerTiming.wrap
  (file:///home/bernardosm/blindpaylabs2/inngest-hono/node_modules/src/helpers/ServerTiming.ts:83:15)
      at async jsonError
  (file:///home/bernardosm/blindpaylabs2/inngest-hono/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
      at async drainBody
  (file:///home/bernardosm/blindpaylabs2/inngest-hono/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
Inngest dev server trying to connect at the same app twice:

image

System info (please complete the following information):

  • OS: Ubuntu 22.04.1 LTS (Running on windows + WSL2)
  • npm package Version: 10.1.0
  • Framework: Hono
  • Platform: Cloudflare Workers
  • Node: v20.9.0

BernardoSM avatar Apr 28 '24 03:04 BernardoSM