webpack-contrib / webpack-hot-client

webpack HMR Client
MIT License
121 stars 45 forks source link

reload is broken #92

Open alexander-akait opened 6 years ago

alexander-akait commented 6 years ago

Expected Behavior

Page doesn't reload.

Actual Behavior

Page should reload.

Code

https://github.com/webpack-contrib/webpack-serve/blob/master/docs/addons/static-content-options.config.js

How Do We Reproduce?

  1. Run example above.
  2. Change something in app.js (page has not been reloaded, because initial: true -> https://github.com/webpack-contrib/webpack-hot-client/blob/master/lib/client/index.js#L30 and https://github.com/webpack-contrib/webpack-hot-client/blob/master/lib/client/index.js#L78)
  3. Change something again (page has been reloaded, all fine)
  4. Change again something in app.js (page has not been reloaded, because after reload page initial was setted in true https://github.com/webpack-contrib/webpack-hot-client/blob/master/lib/client/index.js#L30)

Related problem with css (style-loader and css-loader) - first change not applied because initial: true.

alexander-akait commented 6 years ago

@shellscape found problem, i have external WebSocket (use ws@5 version) client and communicate with webpack-hot-client web socket server, but in webpack-hot-client we use ws@4, it is break web sockets :confused: :disappointed:

What is blocker for update their? We use in own app ws@5 and can't downgrade, also we need communicate with webpack-hot-client web socket server

shellscape commented 6 years ago

The server is supposed to be standards compliant, so I don't know why it would break. You'll have to investigate.

alexander-akait commented 6 years ago

@shellscape problem with compatibility ws@5 and ws@4.

If you use WebSocket.Server from ws@4 and WebSocket (client) from ws@5. WebSocket.Server is freeze after connection. I do not understand deeply ws code. Can we upgrade ws to 5 version?

This makes impossible to use in one application ws (latest stable version - 5.2.2) and webpack-serve

shellscape commented 6 years ago

Maybe, but WebSocket.Server in ws@5 needs to be backwards compatible. I'd check with the ws project about both back compat, and the problem you're facing now.

marcofugaro commented 6 years ago

Yeah I tried running this example from webpack-serve and it doesn't work anymore, not even after using ws@4.0.0

shaytidhar commented 6 years ago

Have the same issue. The hot reload is not working in two different projects - i'm pretty sure the only thing that has been changed was me upgrading to ubuntu 18.04.

Webpack hot realod works, hot reload inside my react app stopped working. Works after rebooting my laptop and stop working again after couple of minutes.