dotenv: different behaviour between load.ts
and mod.ts
when used together with run --watch=
#2490
Labels
load.ts
and mod.ts
when used together with run --watch=
#2490
Describe the bug
When using Deno's watcher (
deno run --watch=file,folder/ …
) in conjunction with dotenv, I get different behaviour with auto loading compared to usingconfig()
. I'm not sure whether the fault lies with dotenv orDeno.env
's handling of changes, though.On a watcher-triggered reload, when using auto-loading, eventual changes in
.env
will not be available viaDeno.env
. When usingconfig()
, they are available.Background: I was implementing an
.env
-based Deno Fresh server configuration (setting the HTTP port etc.) when I noticed that the file changes weren't picked up.Steps to Reproduce
.env
file:app-config.ts
:app-config.ts
and note the current output, "foo":app-load.ts
:app-load.ts
and note the current output, "foo":.env
file:app-config.ts
, the output will be "bar".app-load.ts
, the output will still be "foo".Expected behavior
I expect both scripts to behave the same, they should both output "foo".
Environment
The text was updated successfully, but these errors were encountered: