Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid WebSocket close code when terminating client connection to Miniflare #86

Closed
TimTinkers opened this issue Nov 8, 2021 · 1 comment
Labels
bug Something isn't working fixed-in-next Fixed in next release

Comments

@TimTinkers
Copy link

TimTinkers commented Nov 8, 2021

I am on a Windows PC using Miniflare 2.0.0-next.3.

I am testing a Worker which passes a WebSocket connection off to a Durable Object which in turn passes the connection off to a second Durable Object. When I terminate the connection to this second Durable Object, I receive this error and Miniflare crashes:

TypeError: Invalid WebSocket close code.
    at EventTarget.close (file:///C:/Users/tim/AppData/Local/Volta/tools/image/packages/miniflare/node_modules/miniflare/node_modules/@miniflare/web-sockets/src/websocket.ts:110:29)
    at WebSocket.<anonymous> (file:///C:/Users/tim/AppData/Local/Volta/tools/image/packages/miniflare/node_modules/miniflare/node_modules/@miniflare/web-sockets/src/couple.ts:35:30)
    at WebSocket.emit (node:events:402:35)
    at WebSocket.emitClose (C:\Users\tim\AppData\Local\Volta\tools\image\packages\miniflare\node_modules\miniflare\node_modules\ws\lib\websocket.js:247:10)
    at Receiver.receiverOnFinish (C:\Users\tim\AppData\Local\Volta\tools\image\packages\miniflare\node_modules\miniflare\node_modules\ws\lib\websocket.js:1011:20)
    at Receiver.emit (node:events:390:28)
    at finish (node:internal/streams/writable:750:10)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

I am terminating the connection to that second Durable Object by ^C forcibly killing my local client process.

@mrbbot
Copy link
Contributor

mrbbot commented Nov 13, 2021

Hey! 👋 miniflare@2.0.0-rc.1 has just been released, including a fix for this. You can find the changelog here. Thanks for reporting this, and please let me know if you have any other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed-in-next Fixed in next release
Projects
None yet
Development

No branches or pull requests

2 participants