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
When investigating my issue with Next.js HMR I discovered that the root cause is in fact that express-ws captures all WebSocket upgrades, including those that are unrelated to the routes you've defined with express-ws.
This prevents one from using express-ws in combination with any other WebSocket based software running on the same Node.js HTTP server.
Reproduction repository here, along with a suggestion to work around the issue by skipping on express-ws altogether.
The text was updated successfully, but these errors were encountered:
psarando
added a commit
to psarando/cyverse-de-sonora
that referenced
this issue
Mar 15, 2023
HMR in next.js v12 uses websockets now, which were being consumed or
blocked by `express-ws`. See HenningM/express-ws#162 for example.
This replaces `express-ws` with the `ws` package,
combing a few examples of possible solutions found online.
The `express-ws` project appears dead at this time, and it used `ws`
under the hood anyway.
HMR in next.js v12 uses websockets now, which were being consumed or
blocked by `express-ws`. See HenningM/express-ws#162 for example.
This replaces `express-ws` with the `ws` package,
combining a few examples of possible solutions found online.
The `express-ws` project appears dead at this time, and it used `ws`
under the hood anyway.
When investigating my issue with Next.js HMR I discovered that the root cause is in fact that express-ws captures all WebSocket upgrades, including those that are unrelated to the routes you've defined with
express-ws
.This prevents one from using express-ws in combination with any other WebSocket based software running on the same Node.js HTTP server.
Reproduction repository here, along with a suggestion to work around the issue by skipping on express-ws altogether.
The text was updated successfully, but these errors were encountered: