create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Changes not detected by create react app

Open shabanraza opened this issue 9 years ago • 13 comments

Once i started the project using npm start but doing changes in any file is not detected automatically and livereload doesn't work mostly time How to resolve this issue

shabanraza avatar Jan 11 '17 16:01 shabanraza

What editor are you using?

gaearon avatar Jan 11 '17 16:01 gaearon

There’s some suggestions in https://github.com/facebookincubator/create-react-app/issues/659. Some common causes:

  • Starting project in a Dropbox folder, you need to move it out (https://github.com/facebookincubator/create-react-app/issues/659#issuecomment-247658439)
  • Some editors like Vim and IntelliJ have a "safe write" feature that breaks the watcher, you need to disable it (https://github.com/facebookincubator/create-react-app/issues/659#issuecomment-247808153)
  • Parens in project folder name, you need to remove them until it is fixed (https://github.com/facebookincubator/create-react-app/issues/659#issuecomment-255075752)
  • You might need to tweak system settings (https://webpack.github.io/docs/troubleshooting.html#not-enough-watchers)

gaearon avatar Jan 11 '17 16:01 gaearon

Also, do you have yarn installed? May be related to https://github.com/facebookincubator/create-react-app/pull/1370#issuecomment-272029989.

gaearon avatar Jan 11 '17 23:01 gaearon

I am using webstorm editor as you gave me reference now i disbaled the safe write in webstorm settings.

Now its working fine but i have to test it properly I think this problem shouldn't not be occur in future.

Thanks

On 12-Jan-2017 5:14 AM, "Dan Abramov" [email protected] wrote:

Also, do you have yarn installed? May be related to #1370 (comment) https://github.com/facebookincubator/create-react-app/pull/1370#issuecomment-272029989 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebookincubator/create-react-app/issues/1374#issuecomment-272032009, or mute the thread https://github.com/notifications/unsubscribe-auth/ANNRbLGOw8_94T532XmEs7umhBn9cgWPks5rRWlngaJpZM4LgwTL .

shabanraza avatar Jan 12 '17 04:01 shabanraza

Could you please suggest me which editor should i use so that it can behave properly

shabanraza avatar Jan 12 '17 05:01 shabanraza

cc @prigara, this is a real pain point. Does safe write absolutely have to be on by default?

gaearon avatar Jan 12 '17 11:01 gaearon

@gaearon disabling safe write by default is not an option for us, it might affect too many users, sorry. We are going to start investigating how the webpack file watcher works and hopefully will be able to send a PR to improve it on Window. Should help not only IJ users, but also vim users suffering from the same issue. Any chance you know the main issue for that on the Webpack tracker? Upd: I guess it should be in this project: https://github.com/webpack/watchpack

prigara avatar Jan 12 '17 12:01 prigara

I agree it would be a better solution. Yes, it’s watchpack. AFAIK it uses https://github.com/paulmillr/chokidar under the hood which in turn uses fsevents on OS X, and polling (I think) on other platforms.

gaearon avatar Jan 12 '17 14:01 gaearon

cc @TheLarkInn might provide details / support for prioritizing this on WP side

gaearon avatar Jan 12 '17 14:01 gaearon

@gaearon, I have some good news. After some investigations @alexander-doroshko found a PR that fixes the issue. It has landed in Webpack 2.2, we tested it on Windows and all works like a charm. And it should work both with chokidar and sane.

prigara avatar Jan 17 '17 13:01 prigara

You folks are amazing 💜👯😇

gaearon avatar Jan 17 '17 13:01 gaearon

@gaearon are you planning to move to webpack 2 soon?

prigara avatar Jan 17 '17 13:01 prigara

Within a month of its stable release.

gaearon avatar Jan 17 '17 13:01 gaearon