diff --git a/apps/readest-app/src/app/layout.tsx b/apps/readest-app/src/app/layout.tsx index 59d769fb..4fce12dc 100644 --- a/apps/readest-app/src/app/layout.tsx +++ b/apps/readest-app/src/app/layout.tsx @@ -123,6 +123,13 @@ const devHmrPatchScript = `(${patchTauriHmrWebSocket.toString()})(${JSON.stringi process.env['TAURI_DEV_HOST'], )});`; +// `/runtime-config.js` is a dynamic route handler that only exists in the +// web/Docker build. The Tauri build is statically exported (`output: +// 'export'`), so the file isn't emitted — the request would return the SPA +// fallback HTML and crash with `Unexpected token '<'`. All runtime-config +// consumers fall back to `NEXT_PUBLIC_*` envs baked at build time on Tauri. +const shouldInjectRuntimeConfig = process.env['NEXT_PUBLIC_APP_PLATFORM'] === 'web'; + export default function RootLayout({ children }: { children: React.ReactNode }) { return ( -