{"id":707,"hash":"af240f8e7b52dee0a7d9248a281d027296282e0b10f6adbd9f80b4ba7e139fad","pattern":"WebSocket connection to &#39;ws:&lt;URL&gt;/_next/webpack-hmr&#39; failed: WebSocket is closed before the connection is established","full_message":"Hi am having this problem, i try to make subscriptions with graphql in nextjs, but something is wrong and i dont have any idea how fix it. I am having websocket error - \"WebSocket connection to 'ws:/_next/webpack-hmr' failed: WebSocket is closed before the connection is established.\"\n\nYou can check code here - https://github.com/LoQeN00/messenger-2.0.git\n\nerror\n\ngraphql-setup","ecosystem":"npm","package_name":"reactjs","package_version":null,"solution":"If you are using Nginx:\nhttps://nextjs.org/docs/pages/building-your-application/upgrading/version-12#hmr-connection-now-uses-a-websocket\n\nlocation /_next/webpack-hmr {\n    proxy_pass http://localhost:3000/_next/webpack-hmr;\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n}","confidence":0.8500000000000001,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/71999160/websocket-connection-to-wsurl-next-webpack-hmr-failed-websocket-is-closed","votes":22,"created_at":"2026-04-19T04:51:32.034260+00:00","updated_at":"2026-04-19T04:51:32.034260+00:00"}