You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow user to set WebpackDevServer watchOptions.poll option for react-scripts start #1049
This use case is important to me (and others) because I'm developing in a Docker container, which has issues with inotify (due to mounting volumes with aufs), which precludes the automatic rebuild without the watchOptions poll setting.
We try to avoid config flags like this as much as possible. I wonder if it would be possible to somehow detect that we're in an environment like that and fall back to polling automatically.
Chokidar, which Webpack uses for watching changes has an environment to force the use of polling: CHOKIDAR_USEPOLLING. Does this fix the issue with Docker?
CHOKIDAR_USEPOLLING=true npm start
Reacted by Michael Palumbo, Stanislav, gus!, Kees Kluskens, Thomas Noe, Stéphane, Merlin (they/them), Shane Fulmer, Gavin Gilmour, Kelly and 20 more
Reacted by curli, Pakpoom and Grégoire Joncour
Reacted by curli, Tsaganos Tolis, Adam Gilman, Pakpoom, Jurosh, Grégoire Joncour, aebabis, Jose Angel and Bartiff
Reacted by curli, Tsaganos Tolis, Pakpoom, Grégoire Joncour, aebabis, Samy Ghribi and Lorenzo lopez
It seems that an env variable for polling interval has been requested (paulmillr/chokidar#518) and the author has approved the idea, someone just needs to implement it 😃
Thanks @fson updating script to use CHOKIDAR_USEPOLLING=true react-scripts start helped. Maybe would be nice to put this to react-create-app docs - or just add there reference to webpack docs... what do you guys think? As for many it might be quite an issue to solve watchmode...
Hey, I might be being docker-stupid, but where is this supposed to code? I assumed that you would replace the command but that seems not to be the case?
you know, if all these nodejs people writing cli apps used nconf.env().argv() we'd be able to set configuration through environment variables or command line arguments.
Activity
fson commentedon Nov 16, 2016
We try to avoid config flags like this as much as possible. I wonder if it would be possible to somehow detect that we're in an environment like that and fall back to polling automatically.
YAmikep commentedon Nov 19, 2016
Same for me, I cannot count on inotify since I am using shared folders, vagrant and Virtualbox but I'd like to use polling as a workaround.
fson commentedon Nov 19, 2016
Chokidar, which Webpack uses for watching changes has an environment to force the use of polling:
CHOKIDAR_USEPOLLING. Does this fix the issue with Docker?YAmikep commentedon Nov 19, 2016
Using the env variable works for me.
There does not seem to be an env variable to set the interval though, correct?
fson commentedon Nov 19, 2016
It seems that an env variable for polling interval has been requested (paulmillr/chokidar#518) and the author has approved the idea, someone just needs to implement it 😃
gaearon commentedon Feb 11, 2017
Going to close as there is a path forward (described above) that is out of our control.
jurosh commentedon Jan 26, 2018
Thanks @fson updating script to use
CHOKIDAR_USEPOLLING=true react-scripts starthelped. Maybe would be nice to put this to react-create-app docs - or just add there reference to webpack docs... what do you guys think? As for many it might be quite an issue to solve watchmode...Enable hot reloading on Mac OS X (see react/create-react-app#1049)
togakangaroo commentedon Aug 11, 2018
Hey, I might be being docker-stupid, but where is this supposed to code? I assumed that you would replace the
commandbut that seems not to be the case?Add some development-mode configs for `client`
Add some development-mode configs for `client`
Add some development-mode configs for `client` (#16)
airtonix commentedon Oct 13, 2018
you know, if all these nodejs people writing cli apps used
nconf.env().argv()we'd be able to set configuration through environment variables or command line arguments.