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

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay