webpack-livereload-plugin icon indicating copy to clipboard operation
webpack-livereload-plugin copied to clipboard

livereload.js don't work

Open Steve3029 opened this issue 7 years ago • 11 comments

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"

Steve3029 avatar Apr 02 '18 08:04 Steve3029

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

statianzo avatar Apr 02 '18 16:04 statianzo

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

Steve3029 avatar Apr 02 '18 22:04 Steve3029

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?

statianzo avatar Apr 03 '18 02:04 statianzo

@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.

Steve3029 avatar Apr 03 '18 10:04 Steve3029

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

statianzo avatar Apr 03 '18 16:04 statianzo

Any progress on this?

codabrink avatar Sep 02 '18 21:09 codabrink

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

amiceli avatar Oct 22 '18 09:10 amiceli

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

codabrink avatar Oct 30 '18 01:10 codabrink

Same error using webpack 4.29.1 and plugin version 2.2.0

rachelbriggs avatar Jun 03 '19 16:06 rachelbriggs

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

Ragnoroct avatar Jun 09 '19 20:06 Ragnoroct

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, })

crisamdegracia avatar Apr 19 '21 12:04 crisamdegracia