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.

CRA v4 build with CI=true fails when eslint warnings are present

See original GitHub issue

Describe the bug

After upgrade to v4 of react scripts our CI builds fail due to eslint warnings. In versions 3.x same build passed.

This is problematic for large codebases where there are many pre-existing warnings and we still want to flag them in builds and IDEs to allow engineers to clean them up gradually without blowing up CI builds. We do not want to turn off the rules because the new code they keep us from creating more tech debt. For pre-existing code, it is not feasible to fix all warnings before upgrade to v4.

Steps to reproduce

  1. Clone this repo. https://github.com/gone-skiing/cra-eslint-warning This is a freshly created app with create-react-app, with single line change to introduce unused variable to simulate eslint warning.
  2. Install dependencies npm i
  3. Run npm run build = PASSES (good)

Screen Shot 2020-11-12 at 5 48 39 PM

  1. Run npm run build-with-ci = FAILS (bad) The only difference here is CI=true added to the build script.

Screen Shot 2020-11-12 at 5 48 56 PM

Expected behavior

It is expected that the build will pass with warnings.

Actual behavior

Build fails which blocks the rest of our pipeline.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
henryruhscommented, Dec 9, 2020

@ianmcnally This issue is still present in 4.0.1 - respecting our eslint configuration or not does not change the fact that it fails on warnings…

2reactions
simpsonphilecommented, Jul 21, 2021

any update? Failed to compile on dev with ESLINT_NO_DEV_ERRORS=true

Read more comments on GitHub >

github_iconTop Results From Across the Web

My create-react-app is failing to compile due to ESLint error
This issue has been fixed in the react-scipts:"4.0.3" but, the eslint errors present in the project are not converted to warnings by default ......
Read more >
"Failed to compile" error for any eslint error. i would like to not ...
i tried using https://github.com/bfanger/eslint-plugin-only-warn to make all errors to warnings, but they are still errors.
Read more >
Common React TypeScript ESLint / Lint Errors & Warning ...
In this article, I cover common lint error messages I found in my projects and how I fixed them.
Read more >
Untitled
Center 4 arts homer. Rugui brights telefono, Kaneki touka and nishiki or tsukiyama, Monster sets workout routine, Alpha omega books, Jordan mcelmurry, ...
Read more >
My create-react-app is failing to compile due to ESLint error ...
This issue has been fixed in the react-scipts:"4.0.3" but, the eslint errors present in the project are not converted to warnings by default....
Read more >

github_iconTop Related Medium Post

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