Skip to content

dotenv loaded unexpectedly when useNx: true #3371

@wyardley

Description

@wyardley

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 run

I'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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions