Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Mix HMR not updating after compiling

I have Laravel Mix 4.0.13 installed.

npm run watch works great, and running npm run hot it does seem to compile and detect my changes, recompiling.

However, nothing changes in the browser. In the console I see:

[HMR] Waiting for update signal from WDS...
[WDS] Hot Module Replacement enabled.

And after compiling, I get the following message twice, every time I compile:

[WDS] App updated. Recompiling...

I assume there needs to be another message that says reloading or something?

Another strange thing, if I try to refresh the page, it never loads anything from localhost:8080. It just sits there waiting indefinitely. I have to restart npm run hot and then reload the page.

Both JS/Vue and SASS doesn't reload in the browser.

like image 834
Xethron Avatar asked Feb 07 '19 09:02

Xethron


2 Answers

You probably use .version() in your mix file. Like in the docs, versioning in development is not very useful, so you could;

if (mix.inProduction()) {
  mix.version();
}

Docs: https://laravel.com/docs/5.8/mix#versioning-and-cache-busting

like image 183
Tom Avatar answered Nov 12 '22 20:11

Tom


It seems there is a problem with mix.version(). After removing .version() from my webpack.mix.js file, everything appears to work.

like image 2
Xethron Avatar answered Nov 12 '22 18:11

Xethron