Skip to content

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

Closed

Description

@Bamieh

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.

Activity

  1. Timer commented on Jan 2, 2018

    @Timer
    Contributor

    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.

  2. added a commit that references this issue on Feb 27, 2018
  3. dimaturishchev commented on Apr 6, 2018

    @dimaturishchev

    hi @Timer! can you please provide a link to the discussion where it was decided to treat errors as warnings? Couldn't find it.

  4. jfly commented on Jun 28, 2018

    @jfly

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

  5. mhermosi commented on Oct 19, 2018

    @mhermosi

    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?

  6. Hagsten commented on Oct 23, 2018

    @Hagsten

    @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?

  7. timc13 commented on Nov 12, 2018

    @timc13

    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.

  8. locked as resolved and limited conversation to collaborators on Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions