Vue cli 3 hot reload suddenly not working in browsers

Gilian picture Gilian · Dec 3, 2018 · Viewed 20.4k times · Source

I have a Vue project generated by the Vue cli 3 and my hot reloading suddenly stopped working in my browsers. Changes made to the code are still picked up by the terminal, however, my browser is not picking up the changes. I have to manually refresh in order to pick up the new changes. As suggested by some others I manually set poll: true in my vue.config.js and I also tried to set the proxy, but both had no success.

Any suggestions to make this work again?

Update:

After some Vue updates, it suddenly started working again. I still don't know the reason for this. It might have been a bug in the vue-cli?

Answer

createdbyjurand picture createdbyjurand · Jan 22, 2019

My problem was WDS
Console displayed:

[HMR] Waiting for update signal from WDS...
[WDS] Disconnected!
GET http://ip:port/sockjs-node/info?t=some-number
net::ERR_CONNECTION_TIMED_OUT sockjs.js?some-number

Solution for me was:
in

package.json

change

"serve": "vue-cli-service serve",

to

"serve": "vue-cli-service serve --host localhost",

or
add

module.exports = {
  devServer: {
    host: 'localhost'
  }
}

to

vue.config.js

:)