Support Forums

Build error with parcel on Netlify


I’m working on my new portfolio and when I try to deploy it on Netlify, I got this error:

I tried to add CI= before npm run build but it doesn’t work.

The last error displayed is:
Failed during stage 'building site': Build script returned non-zero exit code: 2

I’m a bit rusty and I can’t find any help on previous similar posts :frowning:

Welcome to the forums @Reikurooo

Strange error.

> parcel build ./src/index.html
[Error: std::bad_alloc]

I cloned your repo and was able to deploy successfully. I made two changes:

  1. Removed "main": "index.js", from package.json as it is incorrect.
  2. Added .parcel-cache to .gitignore so it isn’t pushed to git.

It is possible the .parcel-cache is the root cause, however cannot say for sure. A Support Engineer may have more insight on this.

Damn thank you! It was this folder the issue.

When I used to dev more I never had an issue with this folder, until now ahah.
Have a nice day :slight_smile: