Skip to content
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

feat(core): load root .env files on daemon #22786

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

AgentEnder
Copy link
Member

Current Behavior

We use environment variables for experimental feature flags, which sometimes need to be used on the daemon. Its common to list these variables in a .env file, which is loaded when the CLI is initialized.

The daemon is started with an environment that consists of some custom settings, combined with the process.env. This environment is set as a constant at the module level, so the value is captured the first time the daemon client is required in.

This appears to occur before the dotenv config function has been used, so feature flags specified in .env are not propogated to the daemon correctly.

Expected Behavior

Feature flags specified in .env propogate to the daemon.

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested a review from a team as a code owner April 11, 2024 19:41
@AgentEnder AgentEnder requested a review from Cammisuli April 11, 2024 19:41
Copy link

vercel bot commented Apr 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Apr 11, 2024 7:44pm

@AgentEnder AgentEnder force-pushed the feat/load-dotenv-on-daemon branch from 40f262b to 4e1c0a4 Compare April 11, 2024 19:41
@AgentEnder AgentEnder force-pushed the feat/load-dotenv-on-daemon branch from 4e1c0a4 to b32f131 Compare April 11, 2024 19:42
@AgentEnder AgentEnder merged commit d1584f8 into nrwl:master Apr 12, 2024
6 checks passed
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants