with-zones example causes WebSocket connection fail (HMR) when visiting proxied path
See original GitHub issueWhat version of Next.js are you using?
12.0.7
What version of Node.js are you using?
14.17.6
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
N/A
Describe the Bug
Following the instructions in the “with-zones” example and navigating to /blog
will case the repeating warning to be displayed:
WebSocket connection to 'ws://localhost:3000/blog/_next/webpack-hmr' failed: WebSocket is closed before the connection is established.
Also because of this HMR is not working when editing files in the blog
Next.js app.
Expected Behavior
The HMR client should probably reconnect to the proxied apps HMR server automatically?
To Reproduce
Clone https://github.com/vercel/next.js/tree/canary/examples/with-zones and follow the instructions to start both Next.js apps in dev mode (next dev
). Open http://localhost:3000
in a browser and navigate to blog
. Wait on the WebSocket connection fail warning to display in the console.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:6
Top Results From Across the Web
WebSocket connection to 'ws:<URL>/_next/webpack-hmr' failed
I am having websocket error - "WebSocket connection to 'ws:/_next/webpack-hmr' failed: WebSocket is closed before the connection is ...
Read more >WebSocket - Wikipedia
WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was ...
Read more >Implementing WebSocket communication in Next.js
In this article, I will use Socket.io to show a WebSocket connection between a server and a Next.js application.
Read more >WebSockets for fun and profit - Stack Overflow Blog
Let's start with the basics: WebSocket is a technology that allows a client to establish two-way (“full-duplex”) communication with the ...
Read more >How do I troubleshoot WebSocket issues in Agents (All ...
WebSocketConnectionException: Failed to create connection ... for example: $ cd /path/to/tomcat/bin $ lsof | grep websocket.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The same for me. In Firefox the home app host even completely stuck after some time with following error:
Hey, just created a PR for this issue. The solution seems to work great 😇