Updating Files Does not Cause HMR Reload
I'm working in an application with lots of nested directories and .js files.
Sometimes, after I modify and save the file, it simply... does not update or rebuild. I have to stop the process and restart it.
What's the solution to this?
I had this issue when working with a project that was in a dropbox folder. Hasn't affected any of my projects were outside the folder though.
Not exactly the same, but feels related: Sometimes saving a js-file doesn't trigger the livereload. When I save it a second time it works. Sorry for the lack of details, but happens every now and then and I haven't been able to pinpoint the cause. On windows 10, latest CRA, editing with vim in gitbash.
Same here. In fact I have a very simple project with no nested directories and the rebuilding/reloading is spotty at best. It will just stop rebuilding and hot-reloading so I am continuously having to stop the process and start it all over again. IMHO this is the biggest impedance to a smooth development experience with CreateReactApp. You guys have done such an amazing job thus far, if you could just get this and css preprocessors working you will have nailed it! Keep up the good work!
Can you reproduce this with a freshly created app, or only in existing apps? Has this been always happening, or just recently? Could you please share your system versions?
This could be related to the "safe write" feature some editors use. See "Working with editors/IDEs supporting safe write" from the webpack-dev-server docs.
If this fixes it, and I think it will because I've seen dozens of issues in WDS because of this, I'd suggest to very clearly document this somewhere in CRA :).
@SpaceK33z
Thanks for jumping in. I totally forgot about it.
@danielstern @tbillington @ippa @cpeele00
Does this help?
@gaearon I'll give it a shot and will get back to you. Thanks!
@SpaceK33z: that url seems broken? it doesn't jump to any specific part of the page and I can't even find the word "safe".
It didn't show up for me at first but I saw it after refresh.
@ippa, apparently some dude renamed the whole wiki page for webpack-dev-server to "react-hot", causing some weird issues :(. I renamed it back now, so it should work again.
@gaearon haha see your comment just popping up, see above ;p.
I have a fresh install of create-react-app on Debian 8.5 using text editor Atom and Chrome for browser. When I change App.js and save the reloading is not happening. Any ideas?
Some more things to try here: https://webpack.github.io/docs/troubleshooting.html#watching
@gaearon Absolutely, I was using IntelliJ. It turns out, the Safe Write feature was causing this.Is there some kind of universal editor_config setting that could disable this in editors?
@danielstern, unfortunately this is not supported in editorconfig. But it's a great idea I think! Maybe propose that to the people at http://editorconfig.org/ ?
Another thing that can cause HMR to stop working is parenthesis in a path name. https://github.com/webpack/webpack/issues/2753
@danielstern what did your npm tests return?
I was facing something similar and I had to increase the the max_users_watches http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc
Thank god, this issue was driving me crazy. The 'disable safe write' thing should be in bold in wepback docs...
The 'disable safe write' thing should be in bold in wepback docs...
Oh I made sure of that ;). It's mentioned in the watch docs and is explained at the top of the "how to develop" guide.
Anybody wants to make a PR to Troubleshooting in CRA User Guide?
FWIW, i just tried create-react-app for the first time and hit this. I moved my project out of my Dropbox folder and the problem went away immediately.