File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import Link from 'next/link'
33import { getEnv } from '@/lib/core/config/env'
44import { ExternalRedirect , LegalLayout } from '@/app/(landing)/components'
55
6- /** Opt out of static prerendering so `NEXT_PUBLIC_PRIVACY_URL` is read from
7- * the live runtime environment (e.g. Docker-injected) rather than baked at build. */
86export const dynamic = 'force-dynamic'
97
108export const metadata : Metadata = {
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import Link from 'next/link'
33import { getEnv } from '@/lib/core/config/env'
44import { ExternalRedirect , LegalLayout } from '@/app/(landing)/components'
55
6- /** Opt out of static prerendering so `NEXT_PUBLIC_TERMS_URL` is read from
7- * the live runtime environment (e.g. Docker-injected) rather than baked at build. */
86export const dynamic = 'force-dynamic'
97
108export const metadata : Metadata = {
Original file line number Diff line number Diff line change 11import type { MetadataRoute } from 'next'
22import { getBrandConfig } from '@/ee/whitelabeling'
33
4- /** Opt out of static prerendering so `NEXT_PUBLIC_BRAND_*` is read from
5- * the live runtime environment (e.g. Docker-injected) rather than baked at build. */
64export const dynamic = 'force-dynamic'
75
86export default function manifest ( ) : MetadataRoute . Manifest {
Original file line number Diff line number Diff line change @@ -2,17 +2,10 @@ import { createEnv } from '@t3-oss/env-nextjs'
22import { z } from 'zod'
33
44/**
5- * Universal environment variable getter that works in both client and server contexts.
6- * - Client-side: reads from `window.__ENV`, which `<PublicEnvScript>` from
7- * next-runtime-env populates before hydration (declared globally by that
8- * package). Supports Docker runtime injection of `NEXT_PUBLIC_*` vars
9- * without rebuilding.
10- * - Server-side: reads `process.env` directly.
11- *
12- * We deliberately do not import next-runtime-env's `env()` helper. It calls
13- * `unstable_noStore()` from `next/cache`, which Next 16.2+ rejects when
14- * invoked outside a request scope (e.g. during `next.config.ts` compilation
15- * or top-level module evaluation).
5+ * Reads NEXT_PUBLIC_* env vars in both client and server contexts.
6+ * Client reads `window.__ENV` (populated by `<PublicEnvScript>`); server reads `process.env`.
7+ * We do not use next-runtime-env's `env()` helper because it calls `unstable_noStore()`,
8+ * which Next 16.2+ rejects outside a request scope.
169 */
1710const getEnv = ( variable : string ) : string | undefined => {
1811 if ( typeof window === 'undefined' ) return process . env [ variable ]
You can’t perform that action at this time.
0 commit comments