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
Nope, that it not working. It ends up with a map that contains only the keys of .env.emulator / .env.simulator. All keys from .env are lost. Hitting a breakpoint before the 2nd load reveals that the .env file is properly load.
EDIT: Workaround is to run mergeWith: {...dotenv.env}, but maybe this lib should do it by itself. Also it seems the merged map has higher priority, which feels wrong. I have to load the .env.emulator/ .env.simulator first, although the term mergeWith implies that it will be merged into the given map and thus values should be replaced.
Maybe an argument that defines if merged values will be overwritten or not? Last load values should have higher priority, but this would introduce a breaking change. An argument to toggle priority/overwrite would not.
The text was updated successfully, but these errors were encountered:
martin-braun
changed the title
mergeWith itself not working
mergeWith too limited (cannot merge with itself / cannot overwrite values)
Sep 11, 2022
I try to load an additional .env when running in a emulator/simulator like so:
Nope, that it not working. It ends up with a map that contains only the keys of
.env.emulator
/.env.simulator
. All keys from.env
are lost. Hitting a breakpoint before the 2nd load reveals that the.env
file is properly load.EDIT: Workaround is to run
mergeWith: {...dotenv.env}
, but maybe this lib should do it by itself. Also it seems the merged map has higher priority, which feels wrong. I have to load the.env.emulator
/.env.simulator
first, although the termmergeWith
implies that it will be merged into the given map and thus values should be replaced.Maybe an argument that defines if merged values will be overwritten or not? Last load values should have higher priority, but this would introduce a breaking change. An argument to toggle priority/overwrite would not.
The text was updated successfully, but these errors were encountered: