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

express-ws crashing the app repeatedly #143

Open
TomMettam opened this issue Mar 29, 2021 · 2 comments
Open

express-ws crashing the app repeatedly #143

TomMettam opened this issue Mar 29, 2021 · 2 comments

Comments

@TomMettam
Copy link

My app is constantly restarting due to this uncaught exception in ws

RangeError: Invalid WebSocket frame: RSV1 must be clear
    at Receiver.getInfo (/home/www/caspercontrol-new/node_modules/express-ws/node_modules/ws/lib/receiver.js:167:14)
    at Receiver.startLoop (/home/www/caspercontrol-new/node_modules/express-ws/node_modules/ws/lib/receiver.js:121:22)
    at Receiver._write (/home/www/caspercontrol-new/node_modules/express-ws/node_modules/ws/lib/receiver.js:69:10)
    at writeOrBuffer (_stream_writable.js:352:12)
     at Receiver.Writable.write (_stream_writable.js:303:10)
    at Socket.socketOnData (/home/www/caspercontrol-new/node_modules/express-ws/node_modules/ws/lib/websocket.js:795:35)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:302:12)
    at readableAddChunk (_stream_readable.js:278:9)
     at Socket.Readable.push (_stream_readable.js:217:10)
     at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
   [Symbol(status-code)]: 1002
 }

How can I cleanly handle this error and prevent the app from stopping?

@szabadkai
Copy link

I am experiencing the same issue. No regards to routes.

@mattvb91
Copy link

This problem seems to come from express itself. Ive had to go native to just use http.createServer without express to prevent this issue from happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants