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
dotenv loaded unexpectedly when useNx: true #3371
Comments
Thanks for reporting this @wyardley I have removed the discussion to keep things focused here. We will update the release notes for v6 to highlight this change in default behaviour, and also give you a way to disable the automatic .env loading given that's desirable for your setup. That flag will go out today and I will close this issue once it's ready. |
Awesome. Thanks! |
|
thanks so much for the quick response + fix @JamesHenry! 💯 Is there any way to set options to |
@wyardley in your lerna.json {
"command": {
"run": {
"loadEnvFiles": false
}
}
} |
Awesome. Thanks again; confirming that looks great |
So with Lerna 5.6 with
useNX: true
or Lerna 6, we're seeing a few test cases fail. They all seem to be failing because running the test target with nx enabled seems to be automagically loading an existing.env
file in the directory where the tests runI'm starting to think this behavior is from
nx
itself, maybe because of this:https://github.com/nrwl/nx/blob/a66a549e4bb2bca1c63add7ed40396228c3cbcbb/packages/nx/src/tasks-runner/forked-process-task-runner.ts#L278-L279
Is there a way to disable this behavior? It seems a little overly magical, and is arguably an undocumented breaking change.
The text was updated successfully, but these errors were encountered: