Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webpack-dev-server Disconnect and Trying to reconnect... spam

I just finished an angular project I was working on, but i noticed something in the console, which I'd love to hide if that's possible just to keep everything tidy.

It's the [webpack-dev-server] module constantly disconnecting and trying to reconnect, and spamming my console log. Like this:

polyfills.js:1919 [webpack-dev-server] Live Reloading enabled.
polyfills.js:1919 [webpack-dev-server] Disconnected!
polyfills.js:1919 [webpack-dev-server] Trying to reconnect...
polyfills.js:1919 [webpack-dev-server] Live Reloading enabled.
polyfills.js:1919 [webpack-dev-server] Disconnected!
polyfills.js:1919 [webpack-dev-server] Trying to reconnect...
polyfills.js:1919 [webpack-dev-server] Live Reloading enabled.
polyfills.js:1919 [webpack-dev-server] Disconnected!
polyfills.js:1919 [webpack-dev-server] Trying to reconnect...

Is there a fix for this, or is this just the way it is for now until the application goes into production?

like image 221
Reda Boi Avatar asked Dec 04 '25 14:12

Reda Boi


2 Answers

I managed to solve it with

npx webpack serve --allowed-hosts all

like image 86
user3621978 Avatar answered Dec 07 '25 10:12

user3621978


I had the same problem. The console repeatedly showed the Web Pack Server messages "Disconnected!" and "Trying to reconnect...". But only when the application is running under Chrome. The message does not show up when the application is running under Edge.

I read a lot of threads, but unfortunately nothing helped. Until I realized that my Chrome browser was outdated. After a quick update, the web pack server messages disappeared. Maybe someone else is facing the same issue.

like image 27
Ramona Avatar answered Dec 07 '25 11:12

Ramona



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!