Stop Treating warnings as errors because process.env.CI = true.
See original GitHub issueHello,
When running the react-scripts build
on the CI, the build script does the following
Treating warnings as errors because process.env.CI = true.
This is due to this line of code.
I disagree with treating the CI differently during the build as it creates inconsistency between local environment and the CI. I pushed the code to github knowingly about the warnings, having the CI break from the warning I approved of pushing is rather unexpected to the user.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:6 (1 by maintainers)
Top Results From Across the Web
[Solved] “Treating warnings as errors because of process.env ...
Did deploying your code to netlify failed and in logs you are getting. Treating warnings as errors because of process.env.CI = true. Error...
Read more >How to prevent Netlify from treating warnings as errors ...
Treating warnings as errors because process.env.CI = true. Most CI servers set it automatically. Failed to compile. How can I fix my build?...
Read more >treating warnings as errors because process.env.ci = true.
Open side panel. How to prevent Netlify from treating warnings as errors because process.env.CI = true? Asked Jun 16, 2020 • 73 votes...
Read more >New CI=true build configuration, "Treating warnings as errors ...
There is one more way to affect this behavior: you could instead choose to set the environment variable CI to empty in either...
Read more >Treating warnings as errors because process.env.CI = true
"Treating warnings as errors because process.env.CI = true. Most CI servers set it automatically. Failed to compile.".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
Hi! We’ve had a large discussion about this previously and decided that this is the best default behavior.
If you’d like to not use this behavior, simply set
CI
tofalse
during yourbuild
command, e.g.CI=false npm run build
.What about the other direction? What if I’d like to treat warnings as errors locally? Am I supposed to manually set the
CI
environment variable?I’d prefer the default is to always treat warnings as errors, regardless of the environment, and give people some way to opt out if they think they know what they’re doing (such as @Bamieh).