-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
"[WDS] Disconnected" loop #1796
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
Comments
Feel free to send a PR with fix |
I would love do to exactly that, however I have been unable to track down a proper fix on my own. I have tried, and this was the most I was able to find out. I will continue to research, but I worry that I need assistance to go any further. I had hoped it would be helpful to provide a reproducible test repo in order to get some assistance at least in finding a solution. If creating a reproducible test repo is a waste of time though, please do let me know. |
I had hoped it would be helpful to provide a reproducible test repo in order to get some assistance at least in finding a solution. If creating a reproducible test repo is a waste of time though, please do let me know. No, reproducible test repo allow to us fix problem very fast, i written |
I completely understand, there is no rush for a fix. I just want to help find the solution, so I shared here. I will continue to research also. |
I rolled back to I'm wondering if it has something to do with having Seems related: #851 |
@funwithtriangles can you create minimum reproducible test repo, maybe you have other problem, thanks |
have the same issue since updated from 2.x to 3.2 version with the update of webpack to 4.28.4 previously worked config for
since in here https://webpack.js.org/configuration/dev-server/
this hammer also doesn't work:
here there is |
https://github.com/webpack/webpack-dev-server/blob/master/lib/utils/createConfig.js#L155 |
ok, thanks. I can find in code, just didn't get what it means. Seems it stands for specific |
@blackswanny can you create minimum reproducible test repo with 3 version, |
@evilebottnawi I have this issue too, with SSL mode, in webpack-dev-server 3.3.1. It seems to have come along with Chrome 74. I don't think anything else in my environment changed. I see a failure in the first websocket connection (only for certain routes within my app! and the app reloads continuously). The websocket fails to connect with a timeout (error code 1006). I applied the fix suggested in #851 (comment) to webpack-dev-server, and everything works fine. I can send a merge request if desired. Unfortunately, I do not have a minimum reproduction. FYI, I have my dev server running on a non-standard port with Angular CLI (port 4300 instead of port 4200, though this doesn't seem to make a difference), I have SSL enabled with a fully trusted self-signed cert, with a subject alternative name (which Chrome apparently desires now) and it is marked as fully trusted in Keychain Access app. I do not get any warnings when Chrome first loads the site. I have disableHostCheck set and my app runs on localhost.somedomain.com, which is set in my /etc/hosts file to 127.0.0.1. |
I'm seeing this consistently on both Mac and Windows 10 using Chrome 74, Safari 12.1.1, and Firefox 67. I was able to narrow things down a little: I was upgrading some stale dependencies and saw this error occur, so I restarted the dependency upgrades and was very methodical. This occurred when I jumped from webpack-dev-server 3.2.1 to 3.3.0 (with the corresponding required upgrade of webpack-cli from 3.2.3 to 3.3.2). I'm also extremely far from a minimum reproduction scenario. My solution for now is to stick with webpack-dev-server 3.2.1 / webpack-cli 3.2.3. |
Don't stick version, it can be broken in future, please create minimum reproducible test repo |
If your dev server is behind a proxy, it might be sending requests to the wrong place. I was having a similar issue and solved it with defining |
/cc @elesueur sorry for delay, we need this fix, can you send a PR? |
fyi, I have it with Chrome( latest 74.x version), but I don't have it with Chrome Canary ( 76.x version). So may be something is with my code, but it is fixed in 76.x version of Chrome. Also Firefox and Safari seems to not reproduce it |
I see this consistently with both the release and canary channels of Chrome on Windows 10. |
@ZebraFlesh what do you mean? |
I'm saying it's not resolved by Chrome 76 as @blackswanny suggests |
@ZebraFlesh Can you create minimum reproducible test repo? |
Not easily, no. I've got a privately forked version of this repo: https://github.com/arabold/serverless-react-boilerplate/. It's using serverless framework with the serverless-offline plugin to exec a webpack-dev-server process. I'm not even sure where to begin on unraveling all that into something minimal. My suspicion is that offline environment is doing something that is unexpected by WDS, so "minimal" might still be "quite complicated". |
@ZebraFlesh bad, with reproducible test repo we will fix it very fast |
Just in case it was missed.. there has been a minimum reproducible repo available in the OP all this time. |
I understand that. If I thought I could provide a minimal repo I would have already done so. But like I said, my failure case is quite far from minimal. If you think it would help, I’m happy to try and work it up. |
@ZebraFlesh can you send not minimal version? Sometimes impossible create minimum reproducible test repo |
This branch demonstrates the problem: https://github.com/ZebraFlesh/serverless-react-boilerplate/tree/wds-broken The last commit on that branch causes the issue we've been talking about (by upgrading to latest WDS); reset head to previous commit to get a working version. To execute:
|
@ZebraFlesh thanks |
@ZebraFlesh out of curiosity, does the repo in the OP also have the same problem in your environment? |
@dennispg No, I couldn't make it break using the repo in the OP. I tried on macOS 10.14.5 with node 10.15.3 and Chrome 74. |
Just for extra information, I stopped getting this issue but now I'm testing on iOS Safari and it is happening every time. |
Only on Safari? |
Just tested in Chrome on iOS, same thing happening there. On Android it's fine. 🙁 |
Only iOS? Sorry for many questions |
Chrome on Android: ✔️ |
So I have some sort of solution to this problem, which actually seems to be two problems for iOS. Firstly, there was an issue of the page refreshing really fast (#1370). This doesn't seem to be related to WDS but I managed to get past this issue following this advice: #1370 (comment) However this lead me back to the WDS loop issue, which I seem to have solved by setting |
seems to be related |
If on a vps, Just do a |
Don't know how...but when I add the property injectClient:false to the devServer. The WDS disconnected stops showing up. |
This can generally be fixed by defining
|
Thanks I modified my config to this and it works:
|
We refactor our code and in the next version you will have |
I'm getting this error in Chrome version 92.0.4515.107 and webpack-dev-server 3.11.1 created by |
it means you have invalid URL for sockjs, what is in your address bar in browser |
|
But for web socket connection your are use |
Something buggy in CRA... Sorry, I am afraid we can't fix it here, web socket address should be same as in address bar in browser, if you need proxy, you need more options for dev server, also please try |
Thanks, I'll open an issue with CRA. |
weird, your repo works fine for me, check your env variables, run |
No Tried with port 9090 and got this warning and a bunch of 404s:
I opened an issue on CRA. |
Operating System: Windows 10 - 1809
Node Version: v8.14.0
NPM Version: 6.9.0
webpack Version: 4.30.0
webpack-dev-server Version: 3.3.1
Browser version: Chrome 73.0.3683.103 (64-bit)
This is a bug
This is a modification request
Expected Behavior
Should not repeatedly reload the page after displaying [WDS] Disconnected.
Actual Behavior
Does not strictly happen every single time, sometimes it works. But more often than not, after making a change the hot reload will go into a loop reloading the page and displaying [WDS] Disconnected over and over.
It seems like two "o" sockjs msgs can be received during the same session, possibly when changes are recompiled in succession fast enough? This causes two socket opens, and when the second open request checks the readystate it is already open from the first request and so triggers a [WDS] Disconnect.
How can we reproduce the behavior?
A reproducible repo is available here:
https://github.com/dennispg/webpack-wds-disconnected-bug
npm start
, openhttps://localhost:9000/
in Chromesockjs.js
in the sources panelthis._close(1006, 'Server lost session');
src/index.js
over and over till the breakpoint hits. Try modify/save/modify/save in rapid succession for best results.The text was updated successfully, but these errors were encountered: