react-scripts start should support CI=true, watchAll=false etc.
See original GitHub issueIs your proposal related to a problem?
I’m running react-scripts start
in a CI environment in order to run cypress end-to-end tests. As the project has grown this has started hitting the inotify.max_user_instances
kernel limit which cannot be configured from within a container, this is reported as:
events.js:183
throw er; // Unhandled 'error' event
^
Error: watch /path/to/somewhere ENOSPC
at FSWatcher.start (fs.js:1382:19)
at Object.fs.watch (fs.js:1408:11)
at createFsWatchInstance (/path/to/somewhere
Describe the solution you’d like
react-scripts start
should support flags already used with react-scripts test
that turn off webpack’s file watching, these include env var CI
and commandline flags --watchAll=false
Describe alternatives you’ve considered
I could use my production express server or something else to serve these files, but these aren’t dependencies of the app whereas it’s already using webpack-dev-server with configurable watch options.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:25
- Comments:7
Top Results From Across the Web
Run Create-React-App Tests not in Watch Mode
So for example you can create another script like this: "scripts": { "test:nowatch": "react-scripts test --watchAll=false", }. And then run
Read more >Running Tests | Create React App
*Although we recommend running your tests in watch mode during development, you can disable this behavior by passing in the --watchAll=false ...
Read more >How to set up SonarQube locally on a React TypeScript Project
Let me explain some command options that we've added: --watchAll=false: It is because when executing 'test' script, React will start a watch- ...
Read more >React deploy and test with Azure DevOps - Medium
To start we need to create a free account in the Azure ... ci:unit: npm run test --watchAll=false and will be something like...
Read more >STOP Using Create React App - YouTube
Create React App is a plague and we're here to cure it. Please use Vite, NextJS, or Remix instead. Seriously, anything is better...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a similar-but-not-too-similar use case. I’m currently running VSCode Remote Containers, and
react-scripts start
will hitinotify.max_user_instances
in the container I’m using.I can get around this is by setting the parameter on my host, or another way to get around is to spin up another docker(nginx, apache, etc…).
So yeah, an option to disable watching
node_modules/
will be good.+1 This would be very nice, I’ve hit the
inotify.max_user_instances
limit as well. Increasing the limit worked, but wasn’t ideal in the least. I ended up fixing this in Webpack by adding awebpack.config.js
file with the following:This prevents webpack from watching every file in the
node_modules
directory. It would be appreciated if this was an option in create-react-app.