Skip to content
Latchkey

Webpack build exits with code 1 ("ERROR in") in CI

Webpack finished compiling but emitted at least one "ERROR in" entry, so it exits with code 1. The job fails on that exit code; the actual cause is each "ERROR in" block, not the exit number.

What this error means

The log shows one or more "ERROR in ./path" blocks, then "webpack ... compiled with N errors" and "Process completed with exit code 1".

webpack
ERROR in ./src/index.js 10:0-30
Module not found: Error: Can't resolve './missing' in '/app/src'

webpack 5.91.0 compiled with 1 error in 4213 ms
Error: Process completed with exit code 1.

Common causes

A real compile error in the bundle

An unresolved import, a failed loader, or a syntax error produced an "ERROR in" entry, which makes Webpack exit non-zero.

Warnings escalated to errors

A config or CI flag treats warnings as errors, so an otherwise non-fatal issue fails the build.

How to fix it

Read the first "ERROR in" block

  1. Scroll to the first "ERROR in" entry; later ones are often cascades.
  2. Fix the named module, import, or loader problem.
  3. Re-run until Webpack reports "compiled successfully".

Check whether warnings are failing the build

If the errors are really warnings, decide whether to fix them or stop escalating warnings to errors in CI.

Terminal
# example: a CI flag turning warnings into failures
CI=true npm run build

How to prevent it

  • Fix build errors locally before pushing; they reproduce in CI.
  • Be deliberate about treating warnings as errors.
  • Read the first error, not the exit code, to diagnose.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →