DEV Community

Cover image for how to deploy react project with warnings on netlify.
Vinay Patil
Vinay Patil

Posted on

3 1

how to deploy react project with warnings on netlify.

i was deploying my react page on netlify when I got this error "Build failed due to a user error: Build script returned non-zero exit code: 2"

I saw some warnings related to variable dependencies not being in the useEffect but I didn't want to solve it, so I tried finding a new solution.

and then I saw this:

12:39:50 AM: Treating warnings as errors because process.env.CI = true.
12:39:50 AM: Most CI servers set it automatically.
Enter fullscreen mode Exit fullscreen mode

I thought maybe setting this CI variable to false would solve my problem, and it did so here's the solution for you, if you are suffering from the same.

  • first step is to find deploy settings in your netlify app.

netlify deploy settings auto publishing demo

  • just find deploy settings and scroll down to the environment variables section which looks like this:

netlify environment variables key ci

  • add the new variable CI with the value 'false'.

  • deploy your site again and the error will be solved.

netlify site is live

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up