mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(layout): render PublicEnvScript as plain inline <script>
next-runtime-env's <PublicEnvScript /> uses next/script beforeInteractive internally. On Next.js error-page shells (<html id="__next_error__">), beforeInteractive is not honored — the env script is serialized into the RSC stream instead of being hoisted as a real <script> in <head>, so it runs after client chunks evaluate. Any module that calls getBaseUrl() at module-eval time (e.g. lib/auth/auth-client.ts) then crashes because window['__ENV'] is still undefined. disableNextScript renders a plain inline <script> in <head> that the browser executes synchronously during HTML parse on every render path, including error pages. Fixes "Application error: a client-side exception" on 404 routes like /models/anthropic/xxx and /integrations/rand. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -239,7 +239,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
</>
|
||||
)}
|
||||
|
||||
<PublicEnvScript />
|
||||
<PublicEnvScript disableNextScript />
|
||||
</head>
|
||||
<body className={`${season.variable} font-season`} suppressHydrationWarning>
|
||||
{/* Google Tag Manager (noscript) — hosted only */}
|
||||
|
||||
Reference in New Issue
Block a user