From 247f8398a4545d1709061080b6fce7ca3c51bebc Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Thu, 3 Sep 2026 13:56:29 +0800 Subject: [PATCH] feat(ssr): enable `throwUnhandledErrorInProduction` --- src/client/app/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/app/index.ts b/src/client/app/index.ts index 952e52f5..a15e0684 100644 --- a/src/client/app/index.ts +++ b/src/client/app/index.ts @@ -98,6 +98,12 @@ export async function createApp() { } }) + // set before enhanceApp so users can still disable it or take over with their own errorHandler; + // unhandled errors then fail the build instead of silently shipping broken pages + if (import.meta.env.SSR) { + app.config.throwUnhandledErrorInProduction = true + } + if (Theme.enhanceApp) { await Theme.enhanceApp({ app,