Laravel mix/webpack not registering changes on watch
Hello,
Since Laravel 5.4 changed gulpfile.js to webpack.mix.js compiling assets to the public folder has been buggy for me. I have the unchanged, basic webpack.mis.js file from the Laravel 5.4, but two things concern me:
PHPStorm registers a syntax error when I open this file. Why is this? I haven't changed it since the fresh L5.4 install. (have a look here: http://i68.tinypic.com/2rdc00w.jpg)
When I run npm run watch in CLI terminal it registers that the files are changed, but when I refresh my webpage I don't see any changes. Even when I stop my watcher and run npm run dev the changes do not correspond to what I see in my browser. When I inspect elements, I see lines of code that I deleted (so like the changes has not been updated from my assets to the public folder).
Also I have tried new browsers and clearing cache. I seems that changes to the assets sometimes take 5 minutes (and about 20 to 30 page refreshes) to actually take place. I don't know what the problem is here, but it annoys me.
Also this does not happen 100% of the time. When after a few minutes and tries the webpack changes are pushed to my public folder and seen in the browser the whole thing works for up to a few hours sometimes. Then out of nowhere it starts acting up again and buggs out for a solid 5 to 10 minutes..
I find it hard to explain the problem short and clearly because I can't see the logic in it.
First, I am not sure why you get a syntax error in PHPStorm. I get no such errors with Mix. Check you preferences for file types like scss. Second, Are you absolutely sure you disabled your browser cache? If not, that is why you see no changes.
Second, it should be working. Make sure you are running the latest Node (7.6.0) and Mix (8.0). If you are running the latest of these then you should file an issue on github here.
I am/was pretty sure, but I will try a different chrome-extension to clear my cache.
Command-shift-R does clear the cache, right? Because if so that is not the solution. Since I started working with chrome I used 'force reload' as a standard while developing. But I can't tell for sure now because I might be having a good moment. I will defenitly come back if this persists after a few days.
Node and Mix are on latest indeed.
EDIT:
For people with the same problem. The syntax error in webpack.mix.js was fixed by setting ECMAScript5.1 to ECMAScript6 for JavsScript files. Thanks @ejdelmonico