JAMstack builds fail for the dumbest reasons. You'll push the exact same code that worked yesterday, and suddenly Vercel throws a SIGKILL at your face like you personally offended its mother.
The Real Build Nightmare
Here's the thing nobody tells you: JAMstack moved all the heavy lifting to build time. Your server used to handle image resizing and API calls at runtime, but now everything happens in a tiny container with limited memory and a ticking clock.
Vercel gives you 8GB of memory to work with. Netlify's even more stingy at 1GB for functions. Sounds like a lot until you realize that Node.js eats memory like crazy, Sharp wants to process 200 images simultaneously, and TypeScript decides it needs to compile your entire codebase from scratch.
I've seen builds fail because:
- Someone added one too many high-res images to a Gatsby site
- npm decided to install a slightly different version of some random dependency
- Sharp couldn't figure out what architecture it was running on
- Next.js tried to generate 5000 static pages and ran out of juice
- TypeScript hit some mysterious memory limit during compilation
The Most Common Ways Your Build Dies
Memory Exhaustion (Exit Code 137)
Your build just... stops. No warning, no helpful error message. Just dead. The logs show "SIGKILL" and you're left wondering what the hell happened. Node ate all 8GB of RAM and the system's OOM killer terminated it with extreme prejudice. Exit code 137 means SIGKILL - the system basically said "fuck you, you're dead."
I've debugged this exact scenario at 3am more times than I care to count. Last month, I spent an entire Saturday morning debugging a client's product catalog site that worked perfectly on Thursday but suddenly started dying Friday afternoon. Turns out the marketing team had uploaded 50 new high-res product photos (each like 8MB) and Sharp tried to process them all simultaneously during the Next.js build. Memory went boom at exactly 8.1GB.
Dependency Hell
"Module not found" errors that only happen in production. Your local build works perfectly, but the moment you push to production, Node can't find some package that's definitely installed.
This happens because your package-lock.json
is out of sync, or because you're running Node 18.2.0 locally but production is using 18.1.0, and some native dependency loses its mind over the version mismatch.
Environment Variable Fuckups
You forgot to set an environment variable in production. Your build fails because it can't connect to your database or API during static generation. The error message is usually something unhelpful like "Cannot read property 'data' of undefined."
Sharp Having an Existential Crisis
Sharp is great for image processing, but it's also the source of 90% of my build headaches. It fails with cryptic errors like "Could not load the 'sharp' module" or just randomly decides it doesn't understand JPEG files today.
The worst part? Sharp errors are platform-specific. Your M1 Mac works fine, but the Linux build container loses its fucking mind.