We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.env
https://stackblitz.com/edit/github-p9jzzh
I added NUXT_TEST=reproduction in .env file. It works well in dev and the string reproduction is rendered in page.
NUXT_TEST=reproduction
reproduction
But if I build it and preview with node .output/server/index.mjs, the config in .env does not take effect.
node .output/server/index.mjs
No response
The text was updated successfully, but these errors were encountered:
Start a new pull request in StackBlitz Codeflow.
Sorry, something went wrong.
This is documented behaviour: https://nuxt.com/docs/guide/directory-structure/env#production
Sorry for missing that part in the documentation. For those who want to load .env in production, we can use the built-in functionality since Node v20.6: https://nodejs.org/en/learn/command-line/how-to-read-environment-variables-from-nodejs
node --env-file=.env .output/server/index.mjs
No branches or pull requests
Environment
Reproduction
https://stackblitz.com/edit/github-p9jzzh
Describe the bug
I added
NUXT_TEST=reproduction
in.env
file. It works well in dev and the stringreproduction
is rendered in page.But if I build it and preview with
node .output/server/index.mjs
, the config in.env
does not take effect.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: