You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users of our tooling reported a lot of weird issues lately and i think i finally found the culprit which seems to be related to some change in how .env is handled.
In most our projects we seed some empty .env with things like SENDER=
Up until recently #3847 (comment) this was the behavior in foundry: .env never overwrites global .env. It seems like in a recent nightly the behavior changed and now not only:
.env suddenly has precedence over user env but also
empty values in .env have precedence over user env
So if you e.g. define a:
# intentionally left empty
MNEMONIC_INDEX=
LEDGER_SENDER=
it will overwrite your MNEMONIC_INDEX you might have defined in global env and leads to weird issues like a value is required for '--mnemonic-indexes <INDEXES>' but none was supplied
The text was updated successfully, but these errors were encountered:
Loads environment variables from the specified path.
If variables with the same names already exist in the environment, then their values will be preserved.
Where multiple declarations for the same environment variable exist in your .env file, the first one is applied.
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (cafc260 2024-05-02T00:22:11.188280000Z)
What command(s) is the bug in?
forge script/test/etc
Operating System
macOS (Apple Silicon)
Describe the bug
Users of our tooling reported a lot of weird issues lately and i think i finally found the culprit which seems to be related to some change in how .env is handled.
In most our projects we seed some empty .env with things like
SENDER=
Up until recently #3847 (comment) this was the behavior in foundry: .env never overwrites global .env. It seems like in a recent nightly the behavior changed and now not only:
So if you e.g. define a:
it will overwrite your
MNEMONIC_INDEX
you might have defined in global env and leads to weird issues likea value is required for '--mnemonic-indexes <INDEXES>' but none was supplied
The text was updated successfully, but these errors were encountered: