From 9bad3aee0625e11f2f60b66d765cbb40d945828d Mon Sep 17 00:00:00 2001 From: Mattsson <111893710+mattssonn@users.noreply.github.com> Date: Wed, 26 Aug 2026 20:13:18 +0200 Subject: [PATCH] fix(build): bound Turbopack build memory so Vercel's standard container stops OOM-killing builds (#1958) Since the white-label merge the production build dies with SIGKILL roughly every other run: the compile phase outgrew the standard build machine. turbopackMemoryEviction 'full' evicts finished tasks to the persistent FS cache after every snapshot, bounding the compile working set; cpus 2 caps the static-generation worker pool (default cores-1 full Node processes). The two govern disjoint build phases. Co-authored-by: Claude Fable 5 --- next.config.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/next.config.ts b/next.config.ts index 5c1d12ea..ea86644a 100644 --- a/next.config.ts +++ b/next.config.ts @@ -128,6 +128,17 @@ const nextConfig: NextConfig = { // (lib/reference-data) is independent of this and refreshes on its own. // Default was 0 (always refetch). Static routes keep the 5 min default. staleTimes: { dynamic: 30, static: 300 }, + // Vercel's standard build container OOM-kills the build since 2026-08-26 + // (the tree outgrew it; SIGKILL during "Creating an optimized production + // build"). Two knobs, disjoint phases: + // - compile phase (Turbopack, where the kills happen): evict finished + // tasks to the on-disk cache after every snapshot instead of the lazier + // 'auto' default. Trades some compile speed for a bounded working set; + // requires the persistent FS cache, which is on by default in Next 16. + turbopackMemoryEviction: 'full', + // - static-generation phase: cap prerender workers (default is cores-1; + // each is a full Node process on the shared container RAM). + cpus: 2, }, // PostHog reverse proxy. Keeping analytics same-origin buys three things: // the strict CSP below needs NO posthog hosts (`connect-src 'self'` already