Vercel Build out of memory
Alright, so, a few months ago, some of our updates would trigger this error, but only during development build. Then this week it happened more frequently, until this morning it spreaded into Production. Now we can't push any updates at all because of it.
I wonder if anyone here has been through this? Our app is pretty huge and we tend to avoid third party dependencies as often as possible. We've already ran the profiler and identified a dependency that was extra large and we got rid of it, but still getting this error.
My newest strategy now is to reduce the buddle size with some dynamic imports where it makes sense to.
Are there any other suggestions?
12 Replies
vercel offers 8GB of memory and 2/4 (free/pro) CPUs https://vercel.com/docs/deployments/troubleshoot-a-build#build-container-resources
if you need more than that:
pay enterprise or run on GHA
GitHub actions are generally cheaper, and here some scripts to do it
https://github.com/GentikSolm/gha-examples/tree/main/vercel_pscale
Hmm moving our whole infrastructure to GHA might not be viable now
you can send a ticket to vercel to get some help
GHA?
Yeah
being honest
its the best way to scale builds for vercel
lol
Is the idea to build locally and deploy to Vercel or to build on github?
build on GH
more powerful machines and cheaper
parallel builds
This is shot in a dark, but I once run into issues with memory during build, when we accidentally included files that were not supposed to be included in tailwind config. If you're using tailwind, maybe double check your
content
field in the config.🤔 let me check
Yeah there were js and ts files Included, I don't think that was necessary
But I'm doubtful that will fix it
Something that might be causing this could be the amount of edge runtime pages / endpoints as i found that alot of these can make the build huge