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

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

Closed
Bamieh opened this issue Dec 28, 2017 · 6 comments
Closed

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

Bamieh opened this issue Dec 28, 2017 · 6 comments

Comments

@Bamieh
Copy link

Bamieh commented Dec 28, 2017

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.

@Timer
Copy link
Contributor

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

@Timer Timer closed this as completed Jan 2, 2018
gasolin added a commit to gasolin/ghpage-auto-deploy that referenced this issue Feb 27, 2018
@dimaturishchev
Copy link

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
Copy link

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

jfly added a commit to thewca/tnoodle that referenced this issue Jun 28, 2018
@mhermosi
Copy link

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
Copy link

Hagsten commented 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
Copy link

timc13 commented Nov 12, 2018

I think this is weird implementation as well. There should be a way to keep process.env.CI = true but turn off warnings as errors.

@facebook facebook locked as resolved and limited conversation to collaborators Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants