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
Nx serve not loading .env variable changes with monorepo format (Vite/Vue) #23090
Comments
It's absolutely correct behaviour and not related to NX. |
I can make another sample where you'll see that Vite definitelly does that ! (though with vue 2 and vue-cli it didn't). also, as i put in the first post, modifying the .env cause the following logs : (on non-monorepo setup)
|
The issue here is that Nx is loading the The workaround for now is to use To skip or unload from .env.local file requires changes to the Nx core. Stay tuned! |
…3231) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23090
…3231) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23090 (cherry picked from commit 9122b85)
…3231) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23090
Current Behavior
Using a vite/vue scaffold, running the project through a monorepo architecture and using
nx serve myapp
with a .env.local file containing variableswhen we change a variable from .env, the page will reload, but the variable will match the previous value. We have to restart the nx serve to make it use the new value.
Tested directly with
vite serve
, it does work :[vite] .env.local changed, restarting server...
; but not through nx.I wonder if it's caused by the daemon ? (#22786)
Expected Behavior
Modifying the .env.local restart the nx/vite server.
GitHub Repo
https://github.com/NitroG42/nxenv
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: