I’m having same problem today (3/12/2022).
Gatsby CLI 4.9.1, Gatsby 4.9.3.
Just upgraded from v3 (which I built and deployed earlier today).
V3 and V4 build fine on my machine.
I DO NOT have any Netlify packages explicitly in my package.json, but that was never a problem before.
I’m about to try adding GATSBY_CONCURRENT_DOWNLOAD to 16 in the Netlify env vars.
guys, a few days ago I updated from gatsby from gatsby 4.7.2 to 4.9.1 without any issue, only sometimes I had the EPIPE error but after redeploying it was resolved, but today almost every deploy fails! So I tried almost everything:
adding GATSBY_CONCURRENT_DOWNLOAD variable to 16
GATSBY_CPU_COUNT to 1
Rolled back to 4.7.2
Any ideas? something bad is going on today with netlify?
Thanks for reaching out! Sorry to hear you are experiencing difficulties.
When you say you have tried optimizing images, can you elaborate on that? My first thoughts here would be checking your source images to see if you can reduce their size. Have you addressed the size of source images yet?
Hi, @detosk. An out of memory error (OOM) is typically only able to be resolved by refactoring the code to use less memory during the site build or by using more memory.
Our support team cannot assist with refactoring third-party code as that is outside our scope of support. For getting more memory, you can either upgrade to an Enterprise plan and add the High-Performance Build add-on or you can build locally and use the CLI tool to upload the local builds using the manual deploy process:
@Luke It seems a shame that Netlify’s build memory limit is only 3GB on the ‘Business’ plan, compared to Gatsby Cloud’s ‘Professional’ plan, which gives you an 8GB limit. Gatsby v4 now uses parallel processing during builds to speed things up, resulting in higher memory usage - which is great, but means it’s impossible to build a medium-sized site now on Netllify, as you very quickly can hit the 3GB memory limit. We’ve had to switch a client’s site over to Gatsby Cloud solely because of this Netlify shortcoming.
Bottom line: for medium-sized sites, Netlify does not support Gatsby v4 without the High Performanace Builds add-on, but at $1500 a month per site that’s simply not a sensible option, particularly when Gatsby Cloud gives you a higher build memory limit for just $50 a month. I love Netlify, and would much rather keep all our sites on your framework-agnostic service than start migrating sites over to Gatsby Cloud, but we may have no other choice if Netlify don’t rethink it’s approach to memory limitations. Is there any way you can escalate this issue? I’m sure we’re not the only agency who would consider this a showstopper.
Thanks for following up here and taking the time to share that feedback. I have shared your thoughts internally with all of the relevant teams and I want to assure you that our engineers are looking into this.
Additionally, @chocobuckle, I see you mention that you’re an agency, please do keep in mind that agencies can speak with our Sales about offerings that can fit your business needs. You can follow this link here to see more.
Hello! I’m really happy to say we have a fix for this. It turns out it was not a memory issue after all, but was a bug in Gatsby. It doesn’t appear when building locally because most people are using multi-core machines and the bug only appears when using a single worker. We worked with the Gatsby team to release a fix which went out today. If you update your site to email@example.com then it should fix the problem.
That was more specific to Gatsby 4 - I’m not sure if it’s relevant to Gatsby 2. Also, when using Gatsby 4, the solution is to reduce the CPU count to 1 to ensure stable builds with low memory consumption - not the other way round.