question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hot reload stoped working after updating laravel mix

See original GitHub issue
  • Laravel Mix Version: 0.11.3
  • Node Version: 6.10.2
  • NPM Version: 4.5.0
  • OS: windows 10

My composer json script for hot:

"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",

After updating laravel mix, hot reload stoped working. Scripts cannot be loaded, and when I visit http://localhost:8080/ or http://localhost:8080/js/app.js I get message: Cannot get / or Cannot get /js/app.js

Nothing else was changed and npm run dev still works.

If I use the fix that was posted in https://github.com/JeffreyWay/laravel-mix/issues/599 I can get it to work, but I need to disable extract because they suffer from the same error of Cannot GET /js/manifest.js.

Was there a breaking change and docs don’t reflect it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
JeffreyWaycommented, May 1, 2017

I just merged a PR to fix this.

5reactions
adamgoosecommented, Apr 27, 2017

I added the headers option to the following in setup/webpack.config.js:

module.exports.devServer = {
    historyApiFallback: true,
    noInfo: true,
    compress: true,
    quiet: true,
    headers: {
        'Access-Control-Allow-Origin': '*'
    }
};

This allows CORS requests from all hosts, which is ideal for Laravel Mix IMO (since it’s designed to be portable with minimal config, and allow for dev environments with random local domains). However, this defeats the purpose of the aforementioned patch.

I’d be happy to submit a PR for this, however I’d like @JeffreyWay’s thoughts first. Perhaps Mix’s hot-reload functionality should require this config?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hot reloading not working with laravel/sail [laravel 8] #2719
test because Laravel Mix seems to use the host and port values from hmrOptions to (1) set the values for webpack-dev-server but also...
Read more >
Laravel Mix HMR not updating after compiling - Stack Overflow
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...
Read more >
Hot Module Replacement | Laravel Mix Documentation
Hot Module Replacement (or Hot Reloading) allows you to, not just refresh the page when a piece of JavaScript is changed, but it...
Read more >
laravel - vue, no hot reload - Laracasts
Hot reloading is using webpack-dev-server, it doesn't use any static js file in your public folder and that is why npm run hot...
Read more >
Laravel Mix Hot Module Reloading With React - Medium
Note we are using webpack-dev-server v2 and webpack v3. This is as webpack dev server v2 is for webpack 3, webpack-dev-server v3 is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found