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
Stop Treating warnings as errors because process.env.CI = true. #3657
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.
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.
Reacted by Ethan Neff, KendoJaaa, Jianhao Tan, ChenMengyang, fnsne, Frank Zheng and Darwin
Reacted by Andy Fleming, Joe, Paweł Maciejewski, Nermin Dibek, Matt Campbell, Mike Kobit, Adam Drago, hirohe, Eldar Chamoukhamedov, Kilian Gärtner and 1 more
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).
Reacted by Ahmad Bamieh, Paweł Maciejewski, Dziamid and hirohe
I am wondering what else is it using the env var CI ... if you set it to false beside the error/warning behavior is something else affected by this env var?
@mhermosi to my knowledge the test script is affected. If CI is false then it goes into a watch mode which is something you do not want on a CI-server.
So how do we opt out from "treat errors as warnings" while not using a watcher in the tests? Am I missing something?
Activity
Timer commentedon 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
CItofalseduring yourbuildcommand, e.g.CI=false npm run build.support create-react-app by default
dimaturishchev commentedon Apr 6, 2018
hi @Timer! can you please provide a link to the discussion where it was decided to treat errors as warnings? Couldn't find it.
jfly commentedon 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
CIenvironment 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).
It appears the only way to turn warnings into errors is to set the `C…
mhermosi commentedon Oct 19, 2018
I am wondering what else is it using the env var CI ... if you set it to false beside the error/warning behavior is something else affected by this env var?
Hagsten commentedon Oct 23, 2018
@mhermosi to my knowledge the test script is affected. If CI is false then it goes into a watch mode which is something you do not want on a CI-server.
So how do we opt out from "treat errors as warnings" while not using a watcher in the tests? Am I missing something?
timc13 commentedon Nov 12, 2018
I think this is weird implementation as well. There should be a way to keep
process.env.CI = truebut turn off warnings as errors.