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
Recently I've ran into an issue where I didn't realize that order of environment variables within a dotenv file matters. For example, having two files, .env and .env.local with:
.env
A=C
B=D
.env.local
TESTVAR=$A-$B
A=E
B=F
results in TESTVAR resolving to C-D, basically taking the variables from .env file as they are defined before the TESTVAR itself. However, when moving the TESTVAR variable to the bottom of the file:
A=E
B=F
TESTVAR=$A-$B
makes the TESTVAR variable resolve to E-F, because now the new values are defined earlier.