Skip to content

Follow dotenv-flow variable precedence #491

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

Closed
jleem99 opened this issue Feb 28, 2024 · 2 comments
Closed

Follow dotenv-flow variable precedence #491

jleem99 opened this issue Feb 28, 2024 · 2 comments
Labels
wontfix This will not be worked on

Comments

@jleem99
Copy link

jleem99 commented Feb 28, 2024

The documentation for this library mentions that it follows the dotenv-flow for multi-environment variable loading. (link)

However, I've noticed a minor difference when compared to the dotenv-flow.
According to the dotenv-flow's variables overwriting priority, the variable merging order should be:

  1. .env
  2. .env.local
  3. .env.development
  4. .env.development.local
  5. Command line variables

But in practice, when NODE_ENV='development', the order of variable merging in this library seems to be:

  1. .env
  2. .env.development
  3. .env.local
  4. .env.development.local
  5. Command line variables

This had lead some confusions, for instance, mode-specific variables being unexpectedly overwritten by variables from the .env.local file.

Copy link

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/491

Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 26, 2025
@stale stale bot closed this as completed May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant