-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Disconnected and looping in latest chrome #851
Comments
Actually the fix may have been to add a host: host:"10.0.....", but https://localhost:3000 will spin a lot after [WDS] Disconnected!. This problem seems to be somewhat project specific but I can't narrow down what it is outside of webpack-dev-server 2 using inline. For instance I removed proxy:{..., vpn, route guards etc. Setting wds option inline:false also fixes the problem but we want the page refreshes on code change. |
Does updating to 2.4.2 fix your issue? If not this might be a dupe of #848. |
Upgrading 2.4.2 didn't fix it. I don't have hot module enabled but it may be the same problem, it seems similar. I ran one of angular's seed projects and it worked fine but the project is simplistic. Not sure why binding to a specific host does the trick. BTW my chrome was updated by IT remotely and I just upgraded to latest webpack and started using localhost so there are many changes occuring at once. |
I'm seeing this also. Just since the latest Chrome. Spins a few times "recompiling" and eventually settles down. |
I made a project skeleton that demos the issue. https://github.com/rmanuel200/testwds |
I'm having this issue as well on |
I think I resolved this because I was using - - watch on the command line, but also using a watch plug-in. I dropped the command argument. |
the same on Chrome 58.0.3029.110 (64-bit)。 |
Have the same issue here on Chrome 59.0.3071.86 (32-bit) |
have the same issue here on Chrome 59.0.3071.86 (32-bit) |
Have the same issue here on Chrome 59.0.3071.115 (64-bit) |
Any updates on the issue @Sayan751 posted? Facing the same issue for the same configurations |
Having same issue as well, any updates? chrome version is: |
If anyone can post a link to a simple repo using current dependencies/versions, with vanilla js and without using a framework, that consistently reproduces these symptoms, we'll be happy to take a look and attempt triage. At present none of our tests or examples reproduce this behavior. We're going through issues to try and get the number of them under control so we can more effectively help folks. Closing this one due to age and lack of ability to reproduce, but the discussion is still open. If someone can provide that sample repo, we'd be happy to reopen. |
just add this code to your hosts file, everything will be ok |
having same problems in Chrome 60.0.3112.113 64bit/Windows10
webpack.config.js
However it works in Firefox |
I also have this issue in Chrome Version 61.0.3163.91 (Official Build) (64-bit) (Win 10). webpack 3.5.6 |
The work around with Chrome and windows 10 is to create your own self
signed certificate and install that as a trusted certificate. Then use that
certificate with webpack-dev-server. I used the self signed certificate
that came with IIS/IIS Express by exporting as pfx. There are articles on
the web on how to trust that certificate.
…On 15 Sep. 2017 21:04, "Reverbe" ***@***.***> wrote:
I also have this issue in Chrome Version 61.0.3163.91 (Official Build)
(64-bit) (Win 10).
webpack 3.5.6
webpack-dev-server 2.7.1
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#851 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABFkvUQTLmKsb1msYWSikWdapuHYkPgVks5silmlgaJpZM4MhKqR>
.
|
We resolved this on Chrome/Win10/IIS/https by removing the script tag from the page, and instead use the inline:true flag in the webpackdevserver config. Your mileage may vary. |
Which script tag? |
WORKAROUND "webpack-dev-server": "^2.8.2" Specifically for the infinite refresh issue ([WDS] Disconnected) - I believe the issue is this (after deeper review): the request for a websocket can timeout (transport). webpack-dev-server/client/socket.js sock.onclose eventhandler calls for a reload if this was the "first" connection attempt (retries == 0), when I think we just want to reconnect. for a temproary fix, I manually changed these blocks in the webpack-dev-server/client/socket.js code: sock.onclose = function onclose({ code }) { //catch the code from the event
//bypass the abort if the code is the transporttimeout
//likely should just be: retries > 10, but didn't verify and didn't review cases for retries ===0
if(code !== 1006 && retries === 0) { handlers.close(); };
if(code === 1006) {
timedout = true; //defined private @filelevel
}
// Try to reconnect.
sock = null;
// After 10 retries stop trying, to prevent logspam.
if (retries <= 10) {
// Exponentially increase timeout to reconnect.
// Respectfully copied from the package `got`.
// eslint-disable-next-line no-mixed-operators, no-restricted-properties
const retryInMs = 1000 * Math.pow(2, retries) + Math.random() * 100;
retries += 1;
setTimeout(function cb() {
socket(url, handlers);
}, retryInMs);
}
};
sock.onmessage = function onmessage(e) {
// This assumes that all data sent via the websocket is JSON.
const msg = JSON.parse(e.data);
//special handling for this case, as it triggers a reload.
if(timedout && msg.type == 'ok') {
timedout = false;
handlers['ok'](true);
}
else if (handlers[msg.type]) { handlers[msg.type](msg.data); }
}; and this in webpack-dev-server/client/index.js ok: function msgOk(to) {
sendMsg('Ok');
if (useWarningOverlay || useErrorOverlay) overlay.clear();
if (to || initial) return initial = false; // eslint-disable-line no-return-assign
reloadApp();
}, These changes fix my particular issue |
Your snippet is missing the definition of |
You got it (outside of the function "socket") |
@shellscape Here is a minimal repro of this issue: https://github.com/jonaskello/wds-disconnect-loop-repro |
Had this problem for a while and solved it in a odd way. Dev server starts with 2 adress:
I was using
When i used https://192.168.0.151:8085 in browser instead of localhost, chrome shown the window to accept certificate and proceed. No need for flag. It was not working when i tryed. |
@Rouche This wasn't the case for me. My sockjs is connecting to locahost. Moreover my webpack-dev-server doesn't even listen on an ipaddress besides localhost. Even if it would, that work-around wouldn't work for me, because I use an external service which has a CORS header for a local development setup, but this doesn't work with the IP address because multiple devs (with other IPs connect to it) and a CORD wildcard doesn't work because Chrome just drops CORS wildcards with SSL . |
using 127.0.0.1 instead of localhost fixed this for me 🤷♂️ |
I have fixed this issue by switching to |
@ckarcz, running webpack-dev-server with //cc: @Rouche |
Today after chrome update bang! With vue-cli3 config:
Yo @simardo 👍 |
I tried many of the above suggestions, and I could very much have gotten some things wrong, but here's what worked for me. (I call this "guns a'blazin" mode, where you try anything, out of desperation....) (And note that the following efforts are not listed chronologically. I'm not sure I was sane during the last two days since this issue benighted my life.) I started on Angular 6, ended up Angular 7.0.0-rc1 ---> WDS disconnect still there. And by there, I mean endless looping. Quoth the raven: Disconnected! Finally out of sheer desperation, the country bunkin tried brain surgery using the manual. I have NO idea what I did, but I did exactly what @lukace said he/she did, modifying socket.js and index.js. And.... It worked. What I would like to know is whether the code @lukace modified should be considered a bug to be fixed. For my project, EVERYTHING works now, and it didn't before. All my project was trying to do was redirect to an OAuth2 server to get a security token, and all I was getting was endless looping. All that to say, my project was dead in the water, using all the latest releases. I don't think I had a bug, but this fix was required for my Angular project to work with OAuth2 security. For the sake of the next soul, I log these reflections, but am wondering if an issue should be opened somewhere. Is this a sockjs-client bug? webpack-dev-server bug? @lukace I'm sure what you said was enough to go on, but I'm not a brain surgeon, so I can't discern whether your fix is a global good for all or just a good workaround that has its downsides for other users. As for me I think it's REQUIRED, but hey, I might be biased. I end with these words of gratitude: @lukace you saved my bacon. I'll name my next dog after you. If my wife ever lets me buy one. |
We have a Vue app using webpack-dev-server and encountered the same issue (using version 2.11.3, but it persisted with newer versions as well). After a lot of digging, turns out our problem was multiple websocket connections, specifically SockJS instances, spawning on application load and causing each other to time out and disconnect. The SockJS documentation even points out this problem:
The cause as a badly configured html-webpack-plugin which created dummy JS files instead of loading CSS. Still not entirely sure why/how this happened, though. The way I caught it was by adding a |
Somebody can create minimum reproducible test repo? |
Not sure when this started happening, but it seems to happen in every browser. Here's a repro. |
Works for me,
|
Works for me when I downgrade to 3.1.10, without any additional options. #1604 (comment) |
@c80609a's solution worked for me - actually simply adding |
In our case the issue was due to a mismatch between the host name that Specifically, our local application was running from https://dev.resumize.me, but You can control the host name used by
Hope this helps. |
On chrome works, but I've the same problem on the firefox (64.0) 😢 |
issue resolved after adding below in polyfills.ts file: |
What worked for me was adding config for |
Issue has a lot of post with difference issue, please confirm what issue exists and provide minimum reproducible test repo, thanks! |
Issue was closed due a lot of difference issues in one, also problem should be solved in latest version, anyway feel free to open new issue with reproducible test repo, thanks! |
"webpack-dev-server": "2.4.1",
Using these configurations:
devServer: {
historyApiFallback: true,
stats: 'minimal',
https: true,
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',
//devtool: 'inline-source-map', //fix for IE sourcemaps 404??
Browser console.error:
client?fc09:45 [WDS] Disconnected!
Bug:
[WDS] Disconnected! happens multiple times when historyApiFallback = true
and host is not set.
This will happen about 5 times or more when the ng2 spa is refreshed either through browser or code edit in latest chrome. The server starts fine.
I'm on windows 10 pro v1607 build 14393.953
The text was updated successfully, but these errors were encountered: