Skip to content

Commit

Permalink
hotfix: Web app variables issue
Browse files Browse the repository at this point in the history
  • Loading branch information
BlankParticle committed Jul 22, 2024
1 parent 133039e commit 2e8a7d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/web/src/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ if (!IS_BROWSER) {

PUBLIC_ENV_LIST.forEach((key) => {
const prefixedKey = `NEXT_PUBLIC_${key}`;
process.env[prefixedKey] = process.env[key];
if (typeof process.env[key] !== 'undefined') {
process.env[prefixedKey] = process.env[key];
}
});
}

Expand All @@ -38,7 +40,7 @@ export const env = createEnv({
NEXT_PUBLIC_REALTIME_APP_KEY: z.string(),
NEXT_PUBLIC_REALTIME_HOST: z.string(),
NEXT_PUBLIC_REALTIME_PORT: z.coerce.number(),
NEXT_PUBLIC_TURNSTILE_SITE_KEY: z.string().optional(),
NEXT_PUBLIC_TURNSTILE_SITE_KEY: z.string().default(''),
NEXT_PUBLIC_EE_ENABLED: z.enum(['true', 'false'])
},
// process.env is added here to allow access while on server, it is tree-shaken out in the browser
Expand Down

0 comments on commit 2e8a7d9

Please sign in to comment.