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
When running the Nx CLI from a directory within the workspace (but not the root folder) .env files in the project directories fail to load.
Root .env files also fail to load, but it is unclear whether this is expected (are the .env files listed as 10-18 on the docs intended to be relative to the CWD or explicitly in the workspace root?)
Expected Behavior
If I have a .env file apps/my-app/.env.local and I run cd apps && nx run my-app:serve it should load the environment variables from apps/my-app/.env.local
Current Behavior
When running the Nx CLI from a directory within the workspace (but not the root folder) .env files in the project directories fail to load.
Root .env files also fail to load, but it is unclear whether this is expected (are the .env files listed as 10-18 on the docs intended to be relative to the CWD or explicitly in the workspace root?)
Expected Behavior
If I have a .env file
apps/my-app/.env.local
and I runcd apps && nx run my-app:serve
it should load the environment variables fromapps/my-app/.env.local
GitHub Repo
https://github.com/kylebjordahl/nx-examples/tree/kb/env-loading-repro
Steps to Reproduce
.env
file in the project root from a directory which is not the workspace root(in the reproduction repo, see
apps/env-printer/README.md
)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: