dotenv loaded unexpectedly when useNx: true
See original GitHub issueSo 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:
Is there a way to disable this behavior? It seems a little overly magical, and is arguably an undocumented breaking change.
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
dotenv file is not loading environment variables - Stack Overflow
In my case I created one file in Controller folder and tried to output the require('dotenv').config() --> It was showing me "c:\users\..\controller\.env".
Read more >motdotla/dotenv: Loads environment variables from .env for ...
dotenv. Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env . Storing configuration in the environment ...
Read more >How to use the dotenv.load function in dotenv - Snyk
To help you get started, we've selected a few dotenv.load examples, ... package.json'); require('dotenv').load({ silent: true }); const config = { all: ...
Read more >dotenv-webpack - npm
A simple webpack plugin to support dotenv.. Latest version: 8.0.1, last published: 4 months ago. Start using dotenv-webpack in your project ...
Read more >Env Variables and Modes - Vite
You may see errors like Missing Semicolon or Unexpected token in this case, ... Vite uses dotenv to load additional environment variables from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.
@wyardley in your
lerna.json
you can specify the flag for thelerna run
command:lerna.json