From 02e47a3c173cab2e9e577a0e0f9ef8dc11cacfcd Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Feb 2026 02:29:48 +0000 Subject: [PATCH] fix: abort build on rendering error instead of emitting error HTML Previously, when prerendering failed during build, the error was caught and a fallback error HTML was emitted, allowing the build to complete silently with broken output. Now the error is re-thrown in build mode so the build fails immediately. The graceful fallback (500 status + client re-render) is preserved for dev mode only. https://claude.ai/code/session_01Ffzhp4zABYA1gskj9RCT9r --- packages/static/src/ssr/entry.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/static/src/ssr/entry.tsx b/packages/static/src/ssr/entry.tsx index a454015..6e1d45b 100644 --- a/packages/static/src/ssr/entry.tsx +++ b/packages/static/src/ssr/entry.tsx @@ -82,7 +82,11 @@ export async function renderHTML( }); } } catch (e) { - // In this case, RSC payload is still sent to client and we let client render from scratch anyway. + if (options.build) { + // In build mode, abort the build so the error is not silently swallowed. + throw e; + } + // In dev mode, RSC payload is still sent to client and we let client render from scratch anyway. // This triggers the error boundary on client side. status = 500; htmlStream = await renderToReadableStream(