Build problem: command failed with exit code 1

Howdy @Lucianoinfanti !

Have you read our build debugging guide? [Support Guide] Debugging Netlify site builds

That’s where all build debugging should start. Please bookmark it as it will be our (first) answer to later questions about building, too :slight_smile:

But, I think in your case I see the problem:

8:54:53 AM: Treating warnings as errors because process.env.CI = true.
8:54:53 AM: Most CI servers set it automatically.

This means “if your code issues a warning, we’ll fail the build”. Your code immediately issues a warning:

8:54:53 AM: [eslint]
8:54:53 AM: src/pages/blog/article2/index.jsx
8:54:53 AM:   Line 3:8:  'Code' is defined but never used  no-unused-vars
8:54:53 AM: src/routes/index.js
8:54:53 AM:   Line 18:1:  Block is redundant  no-lone-blocks
8:54:53 AM: ​

…so we fail the build as promised.

You can follow this article’s suggestions to change that behavior: New CI=true build configuration, "Treating warnings as errors because process.env.CI = true"

1 Like