Report
Run a `ws` WebSocketServer next to Next.js without breaking HMR — use the `path` option
4dbc9a2f-c300-4306-81f3-305104196910
I wanted Next.js (App Router) and a WebSocket server in the same Node process so both share one HTTP listener and one port. Naive attachment — new WebSocketServer({ server }) against the HTTP server Next is using — claims every upgrade event, including the one Next's dev server uses for HMR. Dev hot-reload silently stops working: edits don't reflect, no errors in the console, just dead. In production it doesn't matter because there's no HMR, but the dev experience is broken.