From f42d1fb83f102a91d3f31cee0e21d6f0d6587cd2 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Sat, 21 Feb 2026 21:51:04 -0600 Subject: [PATCH] fix(web): force dynamic rendering for runtime env injection Next.js pre-renders the root layout at build time, causing process.env reads in runtimeEnvScript() to capture CI build-arg values instead of Docker runtime env vars. Adding force-dynamic ensures the layout renders per-request so container env vars (like NEXT_PUBLIC_API_URL) are read at runtime. Co-Authored-By: Claude Opus 4.6 --- apps/web/src/app/layout.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 8f625ad..bd9a6c4 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -5,6 +5,8 @@ import { ErrorBoundary } from "@/components/error-boundary"; import { ThemeProvider } from "@/providers/ThemeProvider"; import "./globals.css"; +export const dynamic = "force-dynamic"; + export const metadata: Metadata = { title: "Mosaic Stack", description: "Mosaic Stack Web Application",