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 not publishing changes

See original GitHub issue
  • Laravel Mix Version: 0.11.4
  • Node Version: v6.10.3
  • NPM Version: 3.10.10
  • OS: Ubuntu / Docker container

Description:

Im running laravel with a laravel-mix configuration inside a docker container, but cant seem to get hot reload to work, I can access the static js file, but while running hot and changing files, and even reloading manually the page Im not getting the changes even when the console output from npm run hot seems to be compiling the files.

Steps To Reproduce:

webpack.mix.js


mix
	.options({
		processCssUrls: false
	})
	//.sourceMaps()
	.js('resources/assets/js/admin.js', 'public/js')
       .sass('resources/assets/sass/admin.scss', 'public/css')

Package.json hot reload configuration

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

U can see I made some changes so the host machine can access the webpack-dev-server

In my index I import the js this way (maybe this could be the problem)

<script src="http://10.20.30.1:8080/public/js/admin.js"></script>

I have checked that I have no WebSocket connections open with the server, even when the websockets code seems to be in my admin.js file

/******/ (function(modules) { // webpackBootstrap
/******/ 	function hotDisposeChunk(chunkId) {
/******/ 		delete installedChunks[chunkId];
/******/ 	}
/******/ 	var parentHotUpdateCallback = this["webpackHotUpdate"];
/******/ 	this["webpackHotUpdate"] = 
/******/ 	function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
/******/ 		hotAddUpdateChunk(chunkId, moreModules);
/******/ 		if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
/******/ 	} ;

just a small part of the start of the bundled file

the file also is being loaded on the page image

theres some extra configuration needed for this to work? or could be a problem brought by the webpack server configuration?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

1reaction
jonatangermancommented, Oct 19, 2017

Hi @alejodiazg , I was following your approach as well and hit the same walls 😦 I finally get my HMR working! The last piece missing for this config to work was the ‘localhost:8080’ still used to load the .hot-update.json. And it was apparently due to the generated manifest.js still having ‘localhost:8080’ from the output config in the laravel-mix WebpackConfig.js file I just added: output: { publicPath: Mix.isUsing('hmr') ? 'http://my-vm-ip:8080/' : '', }, to my local webpack.mix.js > mix.webpackConfig, and actually worked! Hope it could be helpful, Cheers,

0reactions
stale[bot]commented, Dec 4, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to Hot Reload on Visual Studio 2022
I was blaming VS for un-functional Hot Reload, but in my case it was caused by trying to Debug ( F5 ) and...
Read more >
Troubleshooting XAML Hot Reload - Visual Studio (Windows)
Error indicates that the change you're attempting isn't supported by XAML Hot Reload. Stop the debugging session, make the change, and then ...
Read more >
React hot reload not working for changes made in index.js
Changes made in index.js is not reflecting on the UI, hence hot reloading fails. For all other files, hot reload works just fine...
Read more >
Edit running code with Hot Reload - JetBrains Rider
Hot Reload, also known as Edit & Continue. Learn how to make changes while running and debugging without restarting the session.
Read more >
Microsoft reveals updates on .NET Hot Reload progress in ...
Hot Reload allows a developer to edit code and apply those changes immediately in an already running application, without needing to restart ...
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