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
theres some extra configuration needed for this to work? or could be a problem brought by the webpack server configuration?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6
Top GitHub Comments
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,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.