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.

Webpack warnings trigger build errors when running on CI

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

21reactions
kachkaevcommented, Dec 18, 2016

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

#...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Treating warnings as errors because process.env.CI = true ...
For me replacing npm run build with CI='' npm run build worked. ... in with Key = CI and Value = false; Press...
Read more >
treating warnings as errors because process.env.ci ... - You.com
Fix “Treating warnings as errors because process.env.CI = true.” in Cloud environment. Open build setting. On Netlity it is, Project > Settings >...
Read more >
npm-ci
Run all build scripts (ie, preinstall , install , and postinstall ) scripts for installed packages in the foreground process, sharing standard input,...
Read more >
New CI=true build configuration, "Treating warnings as errors ...
This setting allows many common libraries to detect a CI environment and change behavior accordingly. One such behavior is the disabling of ...
Read more >
Command Line Interface - webpack
warning. If you want to run webpack using npx please make sure you have webpack-cli installed. ... Build. Run webpack (default command, can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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