statianzo / webpack-livereload-plugin

LiveReload during webpack --watch
ISC License
204 stars 51 forks source link

livereload.js don't work #44

Open Steve3029 opened 6 years ago

Steve3029 commented 6 years ago

My webpack config: plugins: [ new LiveReloadPlugin({port: 3001}) ]

In html page: <script src="http://localhost:3001/livereload.js"></script>

I have got the following error on Chrome: "GET http://localhost:3001/livereload.js net::ERR_CONNECTION_REFUSED"

statianzo commented 6 years ago

Does your webpack log output Live reload listening on port 3001?

Steve3029 commented 6 years ago

No, I haven't got any log showing live reload listening on port 3001.

statianzo commented 6 years ago

If there's no logging, then the plugin server isn't starting. Are you running webpack in watch mode?

What version of webpack are you using? What version of webpack-livereload-plugin? Can you share an entire webpack config that reproduces this issue?

Steve3029 commented 6 years ago

@statianzo I used webpack-livereload-plugin v2.1.1 and webpack 4. And the issue has been fixed when I went back to webpack v3.11.0 and webpack-livereload-plugin v1.0.0.

statianzo commented 6 years ago

Thanks for the report @Steve3029. I'm reopening this as a reminder to look at v2.1.1 with webpack 4.

codabrink commented 6 years ago

Any progress on this?

amiceli commented 5 years ago

Currently with version 2.1.1 and webpack 4.19.1 it works for me.

codabrink commented 5 years ago

Yeah, it seems to have arbitrarily started working again with the latest webpack. Classic Javascript.

rachelbriggs commented 5 years ago

Same error using webpack 4.29.1 and plugin version 2.2.0

Ragnoroct commented 5 years ago

Dumb mistake on my part was running webpack on docker without opening the port for the webpack-livereload-plugin server.

Forwarding that port fixed the ERR_CONNECTION_REFUSED

crisamdegracia commented 3 years ago

Took me many days to make webpack-dev-server work in WordPress coz it needs the HTML file, but I can't. Finally this plugin works!

For some reason, you need to refresh the browser 1st, just one refresh then the live reload will kick in the next time you change the file.

"webpack-livereload-plugin": "^3.0.1",
"webpack": "^5.33.2",
"webpack-cli": "^4.6.0",  

new LiveReloadPlugin({ protocol: "http", hostname : "understraptest.local", appendScriptTag: true, })