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
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.
Oh, this looks tricky. Since the first .env file doesn't have VITE_SOURCE, this flips the order of VITE_SOURCE and VITE_EXPANDED in object keys, which causes VITE_EXPANDED not to expand as per breaking change.
I made two PRs with different approach that resolves this issue: #18981, #18982
We have the third option of not fixing this issue, but I prefer to merge either of the PRs as the current behavior is confusing.
Describe the bug
There seems to be a regression in Vite 6 related to loading extra .env files (.env.local or .env.production) related to parameter expansion.
In the extra loaded .env files where in the normal .env file the same variable is defined the expansion does not work.
Given:
The VITE_SOURCE variable does not get expanded into VITE_EXPANDED
Result:
Expected:
If i specify a variable with the same name in the .env file it does get expanded correctly.
Reproduction
https://stackblitz.com/~/github.com/tionkje/vitejs-vite-hp7equ9q
Steps to reproduce
Run
npm install
followed bynpm run dev
System Info
System: OS: Linux 5.0 undefined CPU: (7) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.20.3 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: vite: ^6.0.3 => 6.0.3
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: