When a build kept running out of memory
A production build failed repeatedly with no clear error. The 908 MB server was running out of memory during TypeScript compilation, and reducing the build's memory use got it compiling reliably again.
What happened
Deploys failed during the build step. The error output did not point to any line of code, so the build looked like it was breaking at random.
Finding the cause
Checking the server while the build ran showed the real limit: the instance had 908 MB of memory, and TypeScript compilation needed more than that. The process was being killed for using too much memory, which is why the error was hard to read.
What I changed
I adjusted the build strategy so it used less memory at once, then verified the application compiled on the same instance. I wrote the steps down so memory usage is the first thing to check next time, instead of guessing at the code.