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
The font file is in node_modules/package/src/fonts/font.ttf, so within the package, this import is correct.
However, Vite then tries to fetch the font file at localhost:5173/fonts/font.ttf and gets a 404.
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
In my app:
@import 'package/src/scss/main.scss';
In package/src/scss/main.scss:
@import 'fonts.scss';
In package/src/scss/fonts.scss:
The font file is in
node_modules/package/src/fonts/font.ttf
, so within the package, this import is correct.However, Vite then tries to fetch the font file at
localhost:5173/fonts/font.ttf
and gets a 404.Reproduction
https://stackblitz.com/edit/vitejs-vite-25cpaq?file=nm/src/scss/fonts.scss
Steps to reproduce
No response
System Info
Used Package Manager
yarn
Logs
Notice in console of repro link:
The URL should not be
/fonts/font.ttf
Validations
The text was updated successfully, but these errors were encountered: