Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Narrow down from string | undefined to string #65248

Merged
merged 9 commits into from
Jun 26, 2024
4 changes: 2 additions & 2 deletions packages/next/src/build/webpack/plugins/define-env-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getNextPublicEnvironmentVariables(): DefineEnv {
for (const key in process.env) {
if (key.startsWith('NEXT_PUBLIC_')) {
const value = process.env[key]
if (value) {
if (value != null) {
icyJoseph marked this conversation as resolved.
Show resolved Hide resolved
defineEnv[`process.env.${key}`] = value
}
}
Expand All @@ -79,7 +79,7 @@ function getNextConfigEnv(config: NextConfigComplete): DefineEnv {
const env = config.env
for (const key in env) {
const value = env[key]
if (value) {
if (value != null) {
icyJoseph marked this conversation as resolved.
Show resolved Hide resolved
errorIfEnvConflicted(config, key)
defineEnv[`process.env.${key}`] = value
}
Expand Down
Loading