New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested font imports 404ing in Vite 2.7.x when a server.origin is set #6622
Labels
documentation
Improvements or additions to documentation
Comments
vite/packages/vite/src/node/plugins/css.ts Lines 218 to 222 in e7f491e
in your case, change origin to http://localhost:3000 (without slash) works.
|
Ah thank you! The docs say to include the trailing slash so it didn't occur to me to remove it. https://vitejs.dev/config/#server-origin |
sapphi-red
added a commit
to sapphi-red/vite
that referenced
this issue
Apr 22, 2022
sapphi-red
added a commit
to sapphi-red/vite
that referenced
this issue
Apr 22, 2022
9 tasks
patak-dev
pushed a commit
that referenced
this issue
Apr 27, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
I am currently experiencing this with Font Awesome, but I imagine it would be an issue in many other cases as well. I am using Font Awesome as a dependency and if I import their compiled css into my
main.js
, the styles are imported fine but the references to the font files inside the CSS produce a 404 in Vitev2.7.x
but it works fine inv2.6.14
.If I set my
server.origin
in myvite.config.js
tohttp://localhost:3000/
for example, the generated link to a font file will look something like the following:http://localhost:3000//node_modules/@fortawesome/fontawesome-free/webfonts/fa-regular-400.woff2
In
v2.6.14
the link looks the same, but does not produce a 404.Reproduction
https://stackblitz.com/edit/vitejs-vite-ajzary?file=main.js
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: