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

fix(core): unloading expanded envs #20524

Closed
wants to merge 1 commit into from
Closed

fix(core): unloading expanded envs #20524

wants to merge 1 commit into from

Conversation

Riron
Copy link

@Riron Riron commented Dec 1, 2023

Current Behavior

When an env is expandable, it is not being unloaded before loading a task environment variables. Hence the initial value (from bin/nx.ts) is kept, and overwrites are not beings used when running the task.
This is because the unloadDotEnvFiles() function is comparing expanded variables with non expanded variables.

Expected Behavior

Every .env, .env.local and .local.env should be unloaded before loading the appropriate envs for a task.

Related Issue(s)

@Riron Riron requested a review from a team as a code owner December 1, 2023 11:23
@Riron Riron requested a review from Cammisuli December 1, 2023 11:23
Copy link

vercel bot commented Dec 1, 2023

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 Dec 1, 2023 11:24am

@Cammisuli
Copy link
Member

Lets wait for #19401 to merge in, then we can add the same check in here with:

if (process.env.NX_EXPAND_ENV !== 'false') {
	/// expand logic
}

@Riron
Copy link
Author

Riron commented Dec 20, 2023

Lets wait for #19401 to merge in, then we can add the same check in here with:

if (process.env.NX_EXPAND_ENV !== 'false') {
	/// expand logic
}

If #19401 takes too long to get merged, should we consider merging this one first and instead adding the condition directly in #19401 ?
This is quite a pain point for us @Cammisuli :)

@xiongemi
Copy link
Collaborator

xiongemi commented Jun 5, 2024

there is another pr #22585 that also tries to fix the same issue. i am going to close this one.

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 Jun 11, 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.

3 participants