-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
dynamic env is an empty object in production when using config.kit.env.dir
#6204
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
Comments
kit.config.env.dir
config.kit.env.dir
config.kit.env.dir
config.kit.env.dir
Based on my testing, this should be fixed with #6179. The problem isn't even the new |
Closing this then since that PR has been merged. Note that it hasn't been released yet |
@benmccann This is the release that you're referring to, yes? If the answer is no feel free to disregard this. If it is, then the issue seems to still exist even after updating to the latest sveltekit (reproduction here). |
that reproduction looks to be on the latest version and any changes from a week ago have certainly been released by now, so I'd expect it to work |
I can't decide if this is intended behavior or not. On one hand, the dynamic env is populated by your adapter at runtime -- in this case, your "adapter" is SvelteKit...? @Rich-Harris Do you think |
Just a heads up that this issue can also be reproduced when using |
This is definitely intended behavior. |
I had falsely assumed that Please feel free to close this issue. |
It does in |
…6635) It wasn't immediately clear to me, #6204, that `$env/dynamic` might be loaded differently depending on `dev`/`prod`. Because `$env/dynamic` included `.env` during `dev`, I erroneously assumed it would do the same during `prod` (a la dotenv). The second sentence could be clearer but I don't know enough about the topic to make it so.
* respect env.dir when running preview - closes #6204 * add test
Describe the bug
config.kit.env.dir
, introduced in #6175, only works in dev.In dev, correct env is logged to console. In prod, empty object is logged to console. Minimal reproduction below.
Reproduction
https://github.com/ambiguous48/dynamic-env-missing
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: