React project build error

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

The following is my failed build logs
2:26:10 AM: Netlify Build
2:26:10 AM: ────────────────────────────────────────────────────────────────
2:26:10 AM: ​
2:26:10 AM: ❯ Version
2:26:10 AM: @netlify/build 29.22.5
2:26:10 AM: ​
2:26:10 AM: ❯ Flags
2:26:10 AM: baseRelDir: true
2:26:10 AM: buildId: 652da33b85048f13fdcb4482
2:26:10 AM: deployId: 652da33b85048f13fdcb4484
2:26:10 AM: ​
2:26:10 AM: ❯ Current directory
2:26:10 AM: /opt/build/repo
2:26:10 AM: ​
2:26:10 AM: ❯ Config file
2:26:10 AM: No config file was defined: using default values.
2:26:10 AM: ​
2:26:10 AM: ❯ Context
2:26:10 AM: production
2:26:10 AM: ​
2:26:10 AM: Build command from Netlify app
2:26:10 AM: ────────────────────────────────────────────────────────────────
2:26:10 AM: ​
2:26:10 AM: $ npm run build
2:26:10 AM: > job-lang-loom@0.0.0 build
2:26:10 AM: > vite build
2:26:10 AM: vite v4.4.11 building for production…
2:26:10 AM: transforming…
2:26:13 AM: ✓ 150 modules transformed.
2:26:13 AM: rendering chunks…
2:26:13 AM: computing gzip size…
2:26:13 AM: dist/index.html 0.45 kB │ gzip: 0.30 kB
2:26:13 AM: dist/assets/index-4ed69a70.css 10.91 kB │ gzip: 3.02 kB
2:26:13 AM: dist/assets/index-de22b3ca.js 223.30 kB │ gzip: 72.68 kB
2:26:13 AM: ✓ built in 2.62s
2:26:13 AM: ​
2:26:13 AM: (build.command completed in 3s)
2:26:13 AM: ​
2:26:15 AM: Failed during stage “building site”: Build script returned non-zero exit code: 2
2:26:15 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:26:15 AM: Failing build: Failed to build site
2:26:15 AM: Finished processing build request in 31.221s

@sravankumar-samala Can you provide the FULL build log?

As despite what it says, I know from experience that it’s entirely possible it actually failed during the “deploy” step.

1 Like

Hi @sravankumar-samala,

Thanks for reaching out!

With the deployId from the log you provided, I was able to find the site. Looking at the full deploy log I see:

Error message
Deploy did not succeed: Deploy directory "build" does not exist

Could you try following the solution mentioned in this Forum post:

Let us know if you have any questions.