Solution for Webpack 5 Dev Server Not Live Reloading

preview_player
Показать описание
There is currently a bug with Webpack 5 and webpack-dev-server not working that is caused by the existence of a browserslist in the project. If you have all those things in your project and your dev server is is not live reloading, this video might give you a temporary solve until the next beta version is out with the permanent fix.

Github Issue:

Repo with code I showed for reference:

#webpackdevserver #webpack #webpack5
Рекомендации по теме
Комментарии
Автор

This has been driving me crazy all day. You have just made me very happy. Thanks!

JonnyIrwin
Автор

Bug is still there (on 5th October 2021 with latest Webpack) - but your fix works perfectly!

najmantube
Автор

Yup, over 5 months later and its still a problem, I think its just apart of normal builds at this point haha. Thank you for this video!

ItalianVoid
Автор

Your videos about webpack are literally saving me ! Thank you man :)

hugoduchesne
Автор

I spent HOURS on this. Thank you for your solution. I'm going to go cry now

jpisty
Автор

My html does not load when i make an update in the code. So to fix that, I set 'hot' to false, and 'liveReload' to true in my webpack.config. Then it is working. 2022 but Webpack 5 still has that bug.

komorebientertainment
Автор

by just adding the target:web tag it worked for me thanks buddy.

brunofilgueiras
Автор

My config is same but live reloading doesn't work... (((

leonidkuznetsov
Автор

You are genious man! Two days wasted! From Russia with love!

eugene
Автор

target: "web " still not working for changing only index.html file, it reflects only after updating index, js file

sujeinthp
Автор

thank you, that worked, i searched on the forums for this solution but I never saw this issuebeing metioned

antoinexgaly
Автор

I was not able to solve this issue, but now it works, Thanks!!!

SaurabhGupta-xvfk
Автор

why webstrom doesnt autosave changes while dev-server running?

islamshg
Автор

I have this issue module not found with css-loader and saas-loader error on ChunkLoaderror, but when I reload the browser. It works!

jittojoyes
Автор

Thank you so much for this video! I was one and a half hour in staring at my screen and wondering why my setup suddenly stopped working. Of course I added a browserlist config right before 😔

helmuthummel
Автор

Found this too late. Ended up finishing a Hackathon without live reloading enabled. I just prebuilt everything and served on node

engine_man
Автор

Thank you very match! It's so helpful information for me!

helixroscko
Автор

Great stuff! Like and subscription. Hope you will make videos about webpack internals and Node API

Ovechkin
Автор

Hello. I am using webpack and the live reloading is working now. But I can't seem to understand why my browser keeps showing wds disconnected just like yours did at the end? Is it something I should be worried about? I am just getting started with react.

sajidmusician
Автор

Thanks for all your webpack videos! – Have you ever had a working ejs setup, where hot reloading works, when you change templates that are actually nested? I never ever could make that work... In case you do, is there any chance to motivate you to do a video on that topic?

RobertWildling