-
Notifications
You must be signed in to change notification settings - Fork 161
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
.env values override existing env vars when using --watch #558
Comments
tandibar
added a commit
to tandibar/fastify-cli
that referenced
this issue
Oct 14, 2022
4 tasks
tandibar
added a commit
to tandibar/fastify-cli
that referenced
this issue
Oct 15, 2022
tandibar
added a commit
to tandibar/fastify-cli
that referenced
this issue
Nov 11, 2022
mcollina
pushed a commit
that referenced
this issue
Nov 14, 2022
…hen using --watch #558 (#564) * fix: prevented .env values from overwriting existing env values when using --watch #558 * fix: prevented .env values from overwriting existing env values when using --watch #558 * test: world because when making a restart the server still passes the arguments that change the environment variable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you start a fastify app with the fastify cli and the watch parameter, the environment variable precedence is changed.
Example
So if you have a
.env
file withand you run
then
process.env.MY_ENV_VAR
will be 'bar'. Perfect! But if you run it with the watch parameter likethen
process.env.MY_ENV_VAR
will be 'foo'.Suggestion
I think it has something to do with this line of code.
The text was updated successfully, but these errors were encountered: