diff --git a/lib/init.ts b/lib/init.ts index 7643999b..c2227513 100644 --- a/lib/init.ts +++ b/lib/init.ts @@ -30,6 +30,13 @@ const OPTIONAL_VARS = [ ] as const function validateEnvironment(): void { + // During Docker builds, NEXT_PUBLIC_* vars are placeholder sentinels + // replaced at runtime by docker-entrypoint.sh. Server-only vars like + // SUPABASE_SERVICE_ROLE_KEY are not available at build time at all. + // Skip validation so Next.js page collection doesn't fail. + const isBuildPlaceholder = process.env.NEXT_PUBLIC_SUPABASE_URL?.startsWith('__') + if (isBuildPlaceholder) return + const missing: string[] = [] for (const v of REQUIRED_CORE_VARS) {