-
-
Notifications
You must be signed in to change notification settings - Fork 917
Open
Labels
Description
What version of Hono are you using?
4.11.3
What runtime/platform is your app running on? (with version if possible)
Cloudflare Workers
What steps can reproduce the bug?
hono.get(
"/ws",
upgradeWebSocket((c) => ({
onMessage: async (ev: MessageEvent, ws) => {
ws.send("hi");
},
})),
);- Connect to the websocket.
- Send a message to the server as client.
- Observe the
hiresponse. - Disconnect the websocket.
- Observe the Cloudflare Workers error:
Uncaught Error: The Workers runtime canceled this request because it detected that your Worker's code had hung and would never generate a response. Refer to: https://developers.cloudflare.com/workers/observability/errors/.
What is the expected behavior?
When disconnecting after sending a message it should not show that error. Interestingly, when connecting, and disconnecting right after without sending a message, it works fine.
What do you see instead?
The following unexpected Cloudflare Workers error: Uncaught Error: The Workers runtime canceled this request because it detected that your Worker's code had hung and would never generate a response. Refer to: https://developers.cloudflare.com/workers/observability/errors/.
Additional information
No response