Deploying new projects started failing on Netlify. Checking the logs I see something that was not in the logs on previous successful deploys:
Treating warnings a
You need to have CI to be false during your build command.
Go to: https://app.netlify.com/sites/mysales-krohne/settings/deploys > Build command and change it to:
CI=false npm run build
Now, rebuild your deployment. Should be no problem anymore.
CI='' npm run build
For more details please check this out HERE
You should put CI='' npm run build
in your build settings.
See error below: https://docs.netlify.com/configure-builds/troubleshooting-tips/#build-fails-on-warning-message
But its better to correct the warnings...
On June 15 2020 Netlify made a configuration change "adding the environment variable CI to build environments, with the value of true." In your Build and Deploy settings on Netlify change your build command to CI= npm run build
. This will prevent Netlify from treating warnings as errors. More discussion on this issue can be found in Netlify's forums.
Simply change the build command to:
CI= yarn build
or
CI= npm build
Like the other posts said, it is due to the CI
, so any warning will stop the build. The lines above just means, setting the CI
variable to nothing, and then start the command yarn build
.
Sometimes even after setting
CI = yarn build or npm build command
the build fails.
In my case, I ran the build command on my local machine and there was an error with an import which was not being displayed in netlify console.
So If the build is failing then run it once on your local machine this will notify of any errors.