You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On preview, the build indicates that the NODE_ENV environment variable is set as the string "undefined" instead of being undefined or "development"/"production".
[ERROR] [vike][Warning] process.env.NODE_ENV==="undefined" which is unexpected: process.env.NODE_ENV is allowed to be the *value* undefined (i.e. process.env.NODE_ENV===undefined) but it shouldn't be the *string* "undefined" https://vike.dev/NODE_ENV
Expected behavior
Setting process.env.NODE_ENV is a widespread convention to tell tools whether your app is being run in development or production.
It's important to respect the following convention: many tools run erroneously otherwise.
📌In development:
Make sure process.env.NODE_ENV is one of these values: ['development', 'dev', '', undefined].
If you use a server, make sure to use createDevMiddleware() for adding the development middleware to your server.
📌In production (and staging):
Make sure process.env.NODE_ENV is a value different than ['development', 'dev', '', undefined].
Screenshots
Additional context
OS: Ubuntu (latest version)
PC: Aspire A315-23
Package Manager: pnpm
Stack:
Cloudflare Workers (via Wrangler)
Mantine
Prettier, ESLint
Sentry
React
The text was updated successfully, but these errors were encountered:
Describe the bug
On preview, the build indicates that the
NODE_ENV
environment variable is set as the string"undefined"
instead of beingundefined
or"development"
/"production"
.[ERROR] [vike][Warning] process.env.NODE_ENV==="undefined" which is unexpected: process.env.NODE_ENV is allowed to be the *value* undefined (i.e. process.env.NODE_ENV===undefined) but it shouldn't be the *string* "undefined" https://vike.dev/NODE_ENV
Expected behavior
Setting
process.env.NODE_ENV
is a widespread convention to tell tools whether your app is being run in development or production.It's important to respect the following convention: many tools run erroneously otherwise.
📌In development:
process.env.NODE_ENV
is one of these values:['development', 'dev', '', undefined]
.createDevMiddleware()
for adding the development middleware to your server.📌In production (and staging):
process.env.NODE_ENV
is a value different than['development', 'dev', '', undefined]
.Screenshots

Additional context
pnpm
The text was updated successfully, but these errors were encountered: