create-react-app: Webpack warnings trigger build errors when running on CI

(Initial discussion starts here.)

Pull request https://github.com/facebookincubator/create-react-app/pull/944 adds a new behaviour related to CIs - crash the build during CI whenever linter warnings are encountered.

This PR however introduced new side effect - webpack warnings will also crash the build, e.g.:

This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.

We could consider this particular warning to be harmless. Since we have no access to webpack config, we cannot use module.noParse option either.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 22 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Same issue here. My temporary workaround was to unset CI variable in the build script (using .gitlab-ci.yml):

#...

build-app:
  stage: build-app
  cache:
    paths:
      - node_modules
    key: "node_modules"
    untracked: true
  script:
    - npm install
    - unset CI # <-------- this line helped
    - npm run build
  artifacts:
    paths:
      - build

#...

I dug a bit further and couldn’t find anything that would provide information about which loader emitted the warning in a reliable manner.

For example an ESLint warning about eqeqeq, loaders property looks like this:

[
  '/system/path/node_modules/babel-loader/index.js?{"babelrc":false,"presets":["/system/path/node_modules/babel-preset-react-app/index.js"]}',
  '/system/path/node_modules/eslint-loader/index.js'
]

There’s also issuer and request which are just long ! webpack strings formed from the info above.

edit. Maybe we could use failOnError and failOnWarning provided by eslint-loader.

Haha, MYSTERY FIX

I’ll keep an eye out on my end for any weird changes here regardless.

The funny thing is we didn’t actually do anything to suppress it. I have no idea why it’s gone 😄