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
While /main.js & //main.js refer to the same asset, and will result in the same asset "source" being served, the latter will be missing any handling of env vars.
While yes, this was a typo, it feels weird that it's not being handled correctly. I'd expect the asset to not resolve or be handled the same in both cases.
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.
rschristian
changed the title
Env vars will not be inserted into assets if they're prefixed with an extra slash
Env vars will not be inserted into assets if the asset is prefixed with an extra slash on request
May 31, 2024
Describe the bug
Somewhat related to #17340
While
/main.js
&//main.js
refer to the same asset, and will result in the same asset "source" being served, the latter will be missing any handling of env vars.While yes, this was a typo, it feels weird that it's not being handled correctly. I'd expect the asset to not resolve or be handled the same in both cases.
Reproduction
https://github.com/rschristian/bug__vite-env-vars
Steps to reproduce
npm install
&&npm run dev
System Info
System: OS: Linux 6.8 EndeavourOS CPU: (4) x64 AMD Ryzen 7 5800X 8-Core Processor Memory: 6.44 GB / 11.65 GB Container: Yes Shell: 5.9 - /usr/bin/zsh Binaries: Node: 18.20.2 - /usr/bin/node Yarn: 1.22.22 - /usr/bin/yarn npm: 10.7.0 - /usr/bin/npm pnpm: 9.1.2 - /usr/bin/pnpm Browsers: firefox-developer-edition: 127.0b4 npmPackages: vite: ^5.2.0 => 5.2.12
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: