0

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?

3
  • 2
    Your eslint warnings will be considered as errors when you are running trying to deploy coz the env process.env.CI is set to true. In local env, these warnings wont interfere in your build. The best option would be to fix these warnings or try to disable the lint for those specific ones which you want to ignore. Commented Jul 12, 2020 at 15:44
  • 1
    Read this post for more clarification and how to remove them from the Netlify community themselves community.netlify.com/t/… Commented Jul 12, 2020 at 15:46
  • @Panther thank you! Looks like they rolled this out last month. I know it's not best practice but if I wanted to shut that off, would I do so in the Settings -> Environment -> edit variables section? Commented Jul 12, 2020 at 15:49

1 Answer 1

8

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Also, I was able to shut that off by setting CI to false in the Settings -> Environment -> edit variables section?
Yes that should work!! Better still would be to remove the warnings altogether.
I like to live dangerously
Stackoverflow to the rescue again ! I also like living dangerously :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.