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

Captures all WebSocket upgrades instead of those related to routes, breaking Next.js HMR #162

Open
raimohanska opened this issue Nov 1, 2022 · 0 comments

Comments

@raimohanska
Copy link

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.

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.
psarando added a commit to psarando/cyverse-de-sonora that referenced this issue Mar 17, 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,
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.
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

1 participant