webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

EventSource failed loading

Open AleCaste opened this issue 8 years ago • 5 comments

Hello I am getting this error on the browser (Chrome v60.0.3112.113): EventSource failed loading: GET "http://localhost:8080/__webpack_hmr" I am using Express v4.15.4, webpack v3.5.6, webpack-dev-server v2.7.1, webpack-hot-middleware v2.19.1 My code looks like this:

  app.use(webpack_dev_middleware(webpack_compiler, {
    publicPath: webpack_configs.output.publicPath,
    stats: {
      'errors-only': true,
      colors: true,
      modules: false,
      children: false,
      chunks: false,
      chunkModules: false        
    }
  }));
  app.use(webpack_hot_middleware(webpack_compiler, {
    log: console.log
  }));
  app.use( express.static(PUBLIC_PATH) );

Any ideas about how can I track the reason of this problem? Thanks!

AleCaste avatar Sep 10 '17 13:09 AleCaste

Hello, I just cloned the current webpack-hot-middleware repository (2.19.11) and ran the example. As you can see on this image, I am still getting the EventSource failed loading error on Chrome.

eventsource_failed_loading

I am running Windows 7. I tried to run the example on Chrome, Opera and Firefox and it fails on all of them. I tried on node version 8.4.0, 6.11.2 and 4.1.1 ... and it fails on all of them. The npm version I am using is 3.10.10

So maybe it is a Windows-only issue, I don't know. But the current webpack-hot-middleware version definitely fails when using SSE.

Any thoughts?

AleCaste avatar Sep 11 '17 11:09 AleCaste

This usually ends up being firewall related. Lots of people have found amit was related to bitdefender

glenjamin avatar Sep 11 '17 12:09 glenjamin

Issue solved. Bitdefender was the cause. See: https://github.com/glenjamin/webpack-hot-middleware/issues/36#issuecomment-182354904 https://github.com/glenjamin/webpack-hot-middleware/issues/189#issuecomment-286158153 https://stackoverflow.com/questions/30625261/server-sent-events-not-send-until-php-script-execution-end/30626490#30626490 https://forums.asp.net/post/5315602.aspx

As for today, it doesn't seem one can do much about it apart from turning Bitdefender off (there is no need to uninstall it!!!)

The strange thing is that we have another web app (built in java, not using node) and SSE works perfectly fine on it even when Bitdefender is on. So I don't know if the issue would have to do with the Express implementation.

Anyhow, good to know that Bitdefender could be the cause of SSE messages being blocked in some cases. Just to be aware of it.

AleCaste avatar Sep 11 '17 12:09 AleCaste

Thanks @glenjamin, I was just writing my last answer about the same thing! Thanks a lot!!!

AleCaste avatar Sep 11 '17 12:09 AleCaste

I have a similar issue, but I do not have bit defender and my adblock is deactivate on my local, nevertheless I am getting the same error. Does anyone know what else would be causing such an issue ?

antkougblenou avatar Mar 02 '21 13:03 antkougblenou