Search code examples
reactjsnpmnetlify

Netlify deploy failed to compile React SPA


I'm able to start the app locally but when attempting to deploy the site, I'm getting the following error log enter image description here

Between the Failed to compile. text and npm ERR! code ELIFECYCLE there seems to be a couple warnings i.e. use of == instead of === and unused variables.

Build command npm run build Publish directory tried both build and build/

Is that what's really causing the failure to deploy or is it something else?


Solution

  • Remove the warnings from your code. That's why the build is failing. You have multiple warnings as shown in this console output. Their CI pipeline is treating warnings as errors because process.env.CI is set to true.