Build script returned non-zero exit code: 1 error

@luke @zltnvrs,
Error running command: Build script returned non-zero exit code: 1
failed during stage ‘building site’: Build script returned non-zero exit code: 1

I want to deploy react js application but I usually got above error code, How can I solve this? Please help !!!

I need advice to debug deploy https://app.netlify.com/sites/hopeful-shirley-ffb643/deploys/5e4656e6a6a1b0987b682409

It runs on localhost successfully. All dependencies have been upgraded yesterday. Its size is less than 10MB.

Repo: https://github.com/Alex-Noir/react_e-commerce_online_store

I deleted my previous 2 messages, because I started over with that problem.

Well, I finally managed to deploy my demo website and in my case the problem indeed occurred because of case-sensitivity, but not from Netlify’s side. Because of Windows being case-preserving (explained here), during push to GitHub styles.js get capitalized to Styles.js (it’s strange, because I do not have any other “styles” files in my folder). So all this time styles.js was capitalized on GitHub and I found out about this only during deployment. Because of this, styles in my paths was “not found” by Netlify, which apparently resulted to “Error running command: Build script returned non-zero exit code: 1”. In my case, capitalizing styles.js manually in VSCode (along with paths), committing and then pushing worked, but it won’t work in case with Netlify (have to use git-mv then).

Also, from what I’ve learned, SPAs have problems with client-side routing. If you use React Router, you should create _redirects file with /* /index.html 200 line in public folder. That will prevent 404.

And the last thing I did is included "homepage": ".", in package.json as written here. That will prevent blank page.

I don’t know, whether it’ll help in your case, @abduljeleelng, but try this.

Now my site is deployed, but it has no images in ReactSlick slider and some FontAwesome icons are missing. I’ll create another topic about this after I get some sleep.

1 Like