Teretto
Teretto

Reputation: 655

Laravel 5 Vue hot module replacement (HMR)

My Vue HOT MODULE REPLACEMENT (HMR) not working. What I have and what I do:

Step by step:

  1. Install fresh laravel composer create-project --prefer-dist laravel/laravel blog
  2. npm i
  3. npm run dev
  4. Open resources\views\welcome.blade.php remove all between <body></body> and add next (see on the bottom)
  5. Check in chrome http://blog/public/. I can see 'Example Component'.
  6. Open chrome DevTools on page and open console in it.
  7. In cmd on project folder run npm run hot and wait for compiling
  8. Hard reload page on chrome (ctrl+f5). In console I see only next. No HRM.
  9. Try to change vue component. In resources\assets\js\components\ExampleComponent.vue add any symbol to html code in template and check chrome page - no any chages. Hard reload page - no any changes!
  10. I do not do more than described above

Code for #4

<div id="app">
    <example-component></example-component>
</div>
<script src="{{ mix('js/app.js') }}"></script>

Help my please!

Upvotes: 0

Views: 4624

Answers (1)

Stephan-v
Stephan-v

Reputation: 20309

It seems the hot module replacement functionality is currently bugged. This is a temporary workaround but this does not solve issues like CSS reloading:

https://github.com/JeffreyWay/laravel-mix/issues/1483#issuecomment-366685986

We will have to wait for a proper fix.

Upvotes: 1

Related Questions