WebSocket connection to 'ws:<URL>/_next/webpack-hmr' failed: WebSocket is closed before the connection is established
Full error 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." You can check code here - https://github.com/LoQeN00/messenger-2.0.git error graphql-setup
Solutionsource: stackoverflow \u2197
If you are using Nginx: https://nextjs.org/docs/pages/building-your-application/upgrading/version-12#hmr-connection-now-uses-a-websocket location /_next/webpack-hmr { proxy_pass http://localhost:3000/_next/webpack-hmr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
API access
Get this solution programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/error/af240f8e7b52dee0a7d9248a281d027296282e0b10f6adbd9f80b4ba7e139fadhash \u00b7 af240f8e7b52dee0a7d9248a281d027296282e0b10f6adbd9f80b4ba7e139fad