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

Quadratic AI

Quadratic AI – The Spreadsheet with AI, Code, and Connections

  • AI-Powered Insights: Ask questions in plain English and get instant visualizations
  • Multi-Language Support: Seamlessly switch between Python, SQL, and JavaScript in one workspace
  • Zero Setup Required: Connect to databases or drag-and-drop files straight from your browser
  • Live Collaboration: Work together in real-time, no matter where your team is located
  • Beyond Formulas: Tackle complex analysis that traditional spreadsheets can't handle

Get started for free.

Watch The Demo πŸ“Šβœ¨

Top comments (0)

Jetbrains Survey

Calling all developers!

Participate in the Developer Ecosystem Survey 2025 and get the chance to win a MacBook Pro, an iPhone 16, or other exciting prizes. Contribute to our research on the development landscape.

Take the survey

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❀️