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
This is basically the exact same situation as a previous bug I brought up, #18993
The reason this happens is because of 2 areas of this plugin, where they use dotenv.config to load the env files for their app (if things haven't been set up yet). They use dotenv because that side of the app isn't vite specific
Per the advice I got from the previous issue, it seems like, again, the mutating of process.env broke the env var processing, and I'm 99% sure the same is happening here. I've tried finding which is a "safe" way to set env vars from plugins, but I wasn't actually able to find any conclusive instructions in the docs.
Now, I am in discussion with the dev of that application, but, realistically, I'm not sure if this is really correct. Should vite's env vars be this... fragile?
I had experienced a fully broken (dev) build from a previous version of this, when they ran dotenv.config, but in the wrong order,
Open the stackblitz, wait for it to load, then change the VITE_MY_ENV_VAR to anything you want. There's no live reload, and even if you save the edited file and the server restarts, there's still no update on the page.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Is your reproduction working now as fixed by aymericzip/intlayer#91?
I think the underlying issue (before their fix) seems same as #17689, so let me close this. Please comment on the original issue if you'd like to share some ideas.
Describe the bug
This is basically the exact same situation as a previous bug I brought up, #18993
The reason this happens is because of 2 areas of this plugin, where they use
dotenv.config
to load the env files for their app (if things haven't been set up yet). They use dotenv because that side of the app isn't vite specifichttps://github.com/aymericzip/intlayer/blob/36cad493b0a2162c0007d95ac1bff5d2dcfca601/packages/%40intlayer/config/src/envVariables/loadEnvFile.ts#L6
and
https://github.com/aymericzip/intlayer/blob/36cad493b0a2162c0007d95ac1bff5d2dcfca601/packages/vite-intlayer/src/intlayerPlugin.ts#L38
Per the advice I got from the previous issue, it seems like, again, the mutating of
process.env
broke the env var processing, and I'm 99% sure the same is happening here. I've tried finding which is a "safe" way to set env vars from plugins, but I wasn't actually able to find any conclusive instructions in the docs.Now, I am in discussion with the dev of that application, but, realistically, I'm not sure if this is really correct. Should vite's env vars be this... fragile?
I had experienced a fully broken (dev) build from a previous version of this, when they ran
dotenv.config
, but in the wrong order,aymericzip/intlayer@59f042d
They ran
instead of
Which wiped out .local settings I was using for my build. That's "their bad", of course, but should vite not protect, or at least warn against that?
Reproduction
https://stackblitz.com/~/github.com/SuperStreaming/intlayerapp?file=.env.development.local
Steps to reproduce
Open the stackblitz, wait for it to load, then change the
VITE_MY_ENV_VAR
to anything you want. There's no live reload, and even if you save the edited file and the server restarts, there's still no update on the page.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: