Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to set WebpackDevServer watchOptions.poll option for react-scripts start #1049

Closed
andrewmillspaugh opened this issue Nov 16, 2016 · 9 comments

Comments

Projects
None yet
7 participants
@andrewmillspaugh
Copy link

commented Nov 16, 2016

This could potentially be done by modifying the instantiation of the WebpackDevServer in start.js to look like:

...
watchOptions: {
  ignored: /node_modules/,
  poll: process.env.REACT_APP_POLL || undefined,
}
...

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.

@fson

This comment has been minimized.

Copy link
Contributor

commented 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

This comment has been minimized.

Copy link

commented 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

This comment has been minimized.

Copy link
Contributor

commented 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?

CHOKIDAR_USEPOLLING=true npm start
@YAmikep

This comment has been minimized.

Copy link

commented 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

This comment has been minimized.

Copy link
Contributor

commented 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

This comment has been minimized.

Copy link
Member

commented Feb 11, 2017

Going to close as there is a path forward (described above) that is out of our control.

@jurosh

This comment has been minimized.

Copy link

commented Jan 26, 2018

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...

@togakangaroo

This comment has been minimized.

Copy link

commented Aug 11, 2018

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?

thecalliopecrashed added a commit to uwcirg/tb-api that referenced this issue Sep 13, 2018

Add some development-mode configs for `client`
The app watches for file changes with the mechanism described at:
* facebook/create-react-app#1049

thecalliopecrashed added a commit to uwcirg/tb-api that referenced this issue Sep 24, 2018

Add some development-mode configs for `client`
The app watches for file changes with the mechanism described at:
* facebook/create-react-app#1049

thecalliopecrashed added a commit to uwcirg/tb-api that referenced this issue Sep 24, 2018

Add some development-mode configs for `client` (#16)
Add some development-mode configs for `client`

When uncommented, these configs will tell the app
to watch for file changes with the mechanism described at:
* facebook/create-react-app#1049
@airtonix

This comment has been minimized.

Copy link

commented 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.

@facebook facebook locked as spam and limited conversation to collaborators Oct 14, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.