You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the loop is over and the Response should close, it throws an error of an uncaught exception which over time throws much severe error in the Cloudflare worker.
I tried to replicate an SSE stream with a plain Worker and everything works as expected:
After digging into hono source code, it seems that flipping preventClose to false in stream.ts solves the issue, a response is closed and there is no uncaught exception. However, I'm not sure what implication this change could have.
What is the expected behavior?
Response should properly close once streamSSE() callback is finished.
What do you see instead?
[wrangler:inf] GET /stream-sse 200 OK (22ms)
✘ [ERROR] A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that [object Object]
✘ [ERROR] Uncaught (in response) Error: The script will never generate a response.
Additional information
It behaves the same with locally running wrangler or deployed to Cloudflare.
The text was updated successfully, but these errors were encountered:
What version of Hono are you using?
3.12.0
What runtime/platform is your app running on?
Cloudflare Workers
What steps can reproduce the bug?
I have this piece of code:
Once the loop is over and the Response should close, it throws an error of an uncaught exception which over time throws much severe error in the Cloudflare worker.
I tried to replicate an SSE stream with a plain Worker and everything works as expected:
After digging into hono source code, it seems that flipping
preventClose
tofalse
in stream.ts solves the issue, a response is closed and there is no uncaught exception. However, I'm not sure what implication this change could have.What is the expected behavior?
Response should properly close once
streamSSE()
callback is finished.What do you see instead?
Additional information
It behaves the same with locally running wrangler or deployed to Cloudflare.
The text was updated successfully, but these errors were encountered: