question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stop Treating warnings as errors because process.env.CI = true.

See original GitHub issue

Hello,

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:closed
  • Created 6 years ago
  • Reactions:11
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

18reactions
Timercommented, Jan 2, 2018

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 to false during your build command, e.g. CI=false npm run build.

4reactions
jflycommented, Jun 28, 2018

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

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found