Description
-
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
- run
npm start
, openhttps://localhost:9000/
in Chrome - find
sockjs.js
in the sources panel - add a breakpoint on line 933 which should look like:
this._close(1006, 'Server lost session');
- add some random semicolons in
src/index.js
over and over till the breakpoint hits. Try modify/save/modify/save in rapid succession for best results.