webpack-dev-server icon indicating copy to clipboard operation
webpack-dev-server copied to clipboard

Disconnected and looping in latest chrome

Open rmanuel200 opened this issue 9 years ago • 80 comments

"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

rmanuel200 avatar Mar 17 '17 22:03 rmanuel200

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.

rmanuel200 avatar Mar 17 '17 22:03 rmanuel200

wds

rmanuel200 avatar Mar 19 '17 21:03 rmanuel200

Does updating to 2.4.2 fix your issue? If not this might be a dupe of #848.

SpaceK33z avatar Mar 19 '17 21:03 SpaceK33z

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.

rmanuel200 avatar Mar 19 '17 21:03 rmanuel200

I'm seeing this also. Just since the latest Chrome. Spins a few times "recompiling" and eventually settles down.

joewood avatar Mar 20 '17 02:03 joewood

I made a project skeleton that demos the issue. https://github.com/rmanuel200/testwds

rmanuel200 avatar Mar 20 '17 20:03 rmanuel200

I'm having this issue as well on [email protected]. The webpack-dev-server client code fails to establish a websocket connection or the websocket is disconnected unexpectedly. Refresh ensues, whole processes starts over and repeats indefinitely. The issue only seems to occur with https enabled. Setting --host localhost per #592 did not resolve the issue.

cwharris avatar May 04 '17 07:05 cwharris

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.

joewood avatar May 05 '17 09:05 joewood

the same on Chrome 58.0.3029.110 (64-bit)。 webpack-dev-server version 2.4.5。 windows 7。

stevexy avatar Jun 02 '17 08:06 stevexy

Have the same issue here on Chrome 59.0.3071.86 (32-bit) webpack-dev-server is the latest version - 2.4.5 OS - Win 7

langshu avatar Jun 06 '17 07:06 langshu

have the same issue here on Chrome 59.0.3071.86 (32-bit) webpack-dev-server is the latest version - 2.5.1 OS - win 10

laizimo avatar Jul 19 '17 07:07 laizimo

Have the same issue here on Chrome 59.0.3071.115 (64-bit) webpack-dev-server version - 2.5.1 webpack version - 2.7.0 OS - Win 10

Sayan751 avatar Jul 20 '17 14:07 Sayan751

Any updates on the issue @Sayan751 posted? Facing the same issue for the same configurations

SofiyaNiaz avatar Jul 20 '17 22:07 SofiyaNiaz

Having same issue as well, any updates?

chrome version is: 59.0.3071.115 (Official Build) (64-bit) webpack version is: 2.6.1 webpack-dev-server version is: 2.4.5 OS is: macOS

izziewong avatar Jul 22 '17 12:07 izziewong

[WDS] Disconnected all the same In Chrome 59, Chrome 58, Firefox 54, webpack no compile.

2017-08-03_205635

webpack: 3.4.1 webpack-dev-server: 2.6.1

ywzhaiqi avatar Aug 03 '17 13:08 ywzhaiqi

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.

shellscape avatar Aug 09 '17 00:08 shellscape

just add this code to your hosts file, everything will be ok 127.0.0.1 localhost

lirongfei123 avatar Aug 22 '17 06:08 lirongfei123

having same problems in Chrome 60.0.3112.113 64bit/Windows10

webpack-dev-server --open --inline --hot --content-base dist/ --config ./config/webpack.config.js --env.dev --env.serve

    "webpack": "^3.5.5",
    "webpack-dev-server": "^2.7.1"

webpack.config.js

      devServer: {
        headers: {
          'Access-Control-Allow-Origin': '*',
        },
      },

However it works in Firefox

madaz avatar Sep 05 '17 03:09 madaz

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

Reverbe avatar Sep 15 '17 11:09 Reverbe

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" [email protected] 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 https://github.com/webpack/webpack-dev-server/issues/851#issuecomment-329751414, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFkvUQTLmKsb1msYWSikWdapuHYkPgVks5silmlgaJpZM4MhKqR .

madaz avatar Sep 15 '17 21:09 madaz