v6.9.5): 4.3.0): After running npm run watch or npm run watch-poll I get the message: DONE Compiled successfully in 11019ms. Next, I change js or css files, but recompiling is not happening. But npm run dev or npm run production are working fine. What's wrong?
webpack.mix.js:
const { mix } = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.js('resources/assets/js/pages.js', 'public/js')
.js('resources/assets/js/srext.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.combine([
'resources/library/**/css/*.css'
], 'public/css/all.css')
.js('resources/library/ext/js/notjs.js', 'public/js/all.js')
.version();
npm run watch or npm run watch-poll
Hi @DevDuckEl,
Not sure whether that's intended, but I've seen the same behaviour whenever I tried to use Wildcard characters for files. In this case, the watching doesn't work.
Try it without the following to confirm:
.combine([
'resources/library/**/css/*.css'
], 'public/css/all.css')
Hi @jastend!
I replaced:
.combine([
'resources/library/**/css/*.css'
], 'public/css/all.css')
to:
.stylus('resources/library/ext/css/notjs.css', 'public/css/all.css')
Recompiling is not happening.
It's really tough to say, when it comes to watcher issues. You might start here:
https://github.com/JeffreyWay/laravel-mix/blob/master/docs/faq.md#im-using-a-vm-and-webpack-isnt-picking-up-my-file-changes
Guys, JeffreyWay linked helped alot. this is my previouse script object in packages.json
` "watch": "cross-env NODE_ENV=development webpack --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
change that to the following
"watch": "cross-env NODE_ENV=development webpack --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
if you notice I've added " --watch-poll " after --watch
I wonder if there's some reason why this suddenly stopped working and this --watch-poll must be added now.
sudo sysctl fs.inotify.max_user_watches=900000000
i fixed this just now by navigating to my webpack.mix.js file located in the root directory this was commented out before mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css'); i then uncommented it and everything works fine with running npm run watch-poll in the terminal
@thibaultvanc worked fine for me. Ubuntu 16.04. Thanks.
Can someone explain why this happens please would be awesome :)
--watch-poll is useful 锛宐ut it consume a lot hardware 锛坈pu锛堾JeffreyWay
@thibaultvanc worked fine for me.on kali rolling 2018.1
@thibaultvanc i waste to much time to solve this issue but your solution saved me thank you
@thibaultvanc Oh thanks! that worked for me!
I am just now having these issues out of nowhere. No fixes suggested here or in the docs have worked.
I am, likewise, having issues with this now. I did recently upgrade my Laravel-based apps from 5.7/5.8 to the current version (8.0 as of this writing), so I don't know if I need to make changes to my webpack.mix.js file to compensate.
As the OP said, the watcher seems to run just fine (like running npm run dev), but then fails to pick up any subsequent changes to the files.
Most helpful comment
sudo sysctl fs.inotify.max_user_watches=900000000