diff --git a/src/core/configuration/ConfigLoader.ts b/src/core/configuration/ConfigLoader.ts index fd8585230..dcfce3c74 100644 --- a/src/core/configuration/ConfigLoader.ts +++ b/src/core/configuration/ConfigLoader.ts @@ -43,8 +43,8 @@ export async function getServerConfigFromClient(): Promise { typeof window !== "undefined" ? window.BOOTSTRAP_CONFIG?.gameEnv : undefined; - const bundledGameEnv = - typeof process !== "undefined" ? process.env?.GAME_ENV : undefined; + // Vite replaces this at build time for browser and worker bundles. + const bundledGameEnv = process.env.GAME_ENV; const gameEnv = bootstrapGameEnv ?? bundledGameEnv; if (!gameEnv) { throw new Error("Missing client server config");