-
Notifications
You must be signed in to change notification settings - Fork 65
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
nuxt preview does not respect the --dotenv option #383
Comments
Start a new pull request in StackBlitz Codeflow. |
I have just experienced the same (with Nuxt Doc says it should work (https://nuxt.com/docs/api/commands/preview) But my terminal even says it's just going to load I hope this helps possibly locate the issue. |
Been going mad experiencing the exact same issue. Nuxt 3.13.2. |
Same problem here, any updates? |
As a workaround, read in the .env variables as you'd have to on the server 👍🏻 |
3fe1ff9 only appears to fix the console message, which is great, but doesn't address the reported issue ( |
Would you provide a reproduction of it not working? It works fine for me - including in the originally provided stackblitz: |
Ah, the original stackblitz repro is also working for me (first time trying it I'll admit). Hmm, need to double check my local project now... |
Yep, not sure where the confusion stems from but my local project is behaving as expected now. Apologies for the noise. |
Environment
Stackblitz
Reproduction
https://stackblitz.com/edit/nuxt-starter-qwahbu?file=package.json
Describe the bug
I have 2 environment files
.env
and.env.prod
. According to the docs, I can pass the--dotenv
flag to specify a different env file to load for nuxt preview command - https://nuxt.com/docs/api/commands/previewBut it does not seem to work.
I have tried multiple variants of this and it always loads the
.env
file and not my.env.prod
file.Here is what I tried (see reproduction):
Nothing worked.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: