Laravel Mix HMR not updating after compiling
Asked Answered
D

4

7

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.

Domel answered 7/2, 2019 at 9:15 Comment(0)
A
10

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

Archduke answered 13/5, 2019 at 8:2 Comment(1)
Last night, I was checking everything worked fine. I used git to mark where it worked. but IDK why I committed with version. reverting to those versions didn't work until I reach this question and answers -_- Thanks.Bhutan
D
3

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

Domel answered 7/2, 2019 at 9:48 Comment(1)
I am sure it's inappropriate to say but FML -_-Bhutan
B
0

Also maybe file is in different case, like 'element.vue' or 'Element.vue'

Burrton answered 10/5, 2022 at 15:8 Comment(0)
T
0

Make sure you include manifest.js in the page

Tittivate answered 28/9, 2022 at 1:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.