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
I expect imgUrlAlias === 'http://localhost:5173/src/assets/vue.svg'
but what I really get is imgUrlAlias === 'http://localhost:5173/undefined'
if I replace '@/assets/img.png' with './assets/img.png' or '/src/assets/img.png'
I can get the right url 'http://localhost:5173/src/assets/vue.svg'
when I check Source Code from Developer Tools I notice that
the assign part Object.assign({"/src/assets/vue.svg": __vite_glob_0_0})) is handled '@' alias correctly
but the index part [`@/assets/${imgName}.svg/`] didn't
I think this may be a bug
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.
Describe the bug
when I importing Asset according to Vite Guide
I expect
imgUrlAlias === 'http://localhost:5173/src/assets/vue.svg'
but what I really get is
imgUrlAlias === 'http://localhost:5173/undefined'
if I replace
'@/assets/img.png'
with'./assets/img.png'
or'/src/assets/img.png'
I can get the right url
'http://localhost:5173/src/assets/vue.svg'
when I check Source Code from Developer Tools I notice that
is compiled to
the assign part
Object.assign({"/src/assets/vue.svg": __vite_glob_0_0}))
is handled '@' alias correctlybut the index part
[`@/assets/${imgName}.svg/`]
didn'tI think this may be a bug
Reproduction
https://github.com/Chains-Z/vite-asset-alias-issue
Steps to reproduce
Run
npm install
followed bynpm run dev
You can see that the middle Vue Logo didn't show up
the reproduce code is in
App.vue
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: