-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Icon font regression when using Vite #1381
Comments
Very likely, this is related to vitejs/vite#7651 - Vite SASS processor is unable to peoperly rebase So move from (1.8.3):
to (1.9)
killed the Vite importer. As a workaround, we can import the generated CSS like this:
It skips SASS and in plain CSS the |
Can confirm this is still an issue regarding the latest versions. Using Vite and SASS, |
Old version kept: - bootstrap-icons, 1.9 changed scss to use variables in font urls which broke compatibility with vite's scss processing. bootstrap-icons seems to have valid scss, so the actual problem is with Vite (and sass not supporting url rewriting). Importing bootstrap-icons.css could be used as a workaround. See: - twbs/icons#1381 - vitejs/vite#7651 - sass/sass#1015 - sass/sass#2535 - sass/sass#2927 Updated only up to minor version: - @types/node, still using Node 16 as it's the latest LTS at this time
Any idea what the Vite Sass compiler is doing that's different than the usual Sass compilation? We're not seeing any build errors on our end. |
parcel.js is failing in similar way too: parcel-bundler/parcel#6285 except that the |
This should be fixed in main and will be in v1.10.4. |
I am still seeing the same erratic behavior, even after upgrading to 1.10.5 |
I know this is old, so not meaning to necro, but Vite 4.x changed the default charset to UTF-8 and recommends people ensure they're using the correct Thread: vitejs/vite#13676 (comment) |
I think this issue should be re-opened as the problem still persists. |
I'm using version I get this error in the console: And this error in the server (Django server, vite server doesn't log anything): Is there any news about this bug or other workarounds? |
I use the workaround given by @cernyjakub and @tyqualters which is to include the plain css instead of the sass version. I describe the same workaround in my blog How to Install Bootstrap in Laravel With Vite This is far from ideal, I'd prefer to be able to use the sass version. |
@jhjvandenbroek do you use the same versions ( |
No, I used: vite 4.4.7 |
Still an issue with vite 5.0 and bootstrap-icons 1.11.3; but the workaround of using the compiled css still works in the interim. |
Does anyone have a different solution or workaround to this very same problem? |
I have the same problem with "bootstrap-icons.min" file. I wrote direct path, but I had no success: "Internal server error: Failed to resolve import "D:/web-work/vite_react_lrn/node_modules/bootstrap-icons/font/fonts/bootstrap-icons.min.css" from "src/App.jsx". Does the file exist?". I decided to export only font in a .css file : @font-face{ and styling in .CSS the tag: color, font-size e.t.c. I inserting HTML codes (code point,or unicode, they are available on the Bootstrap-icons site for each icon) inside the "I" html tag that represents type of the Icon. |
I suppose even adding |
Hello!
I have been using icon font in Vite by simpley including 1 line in my SCSS file:
@import 'bootstrap-icons/font/bootstrap-icons';
After updating to 1.9, this is no longer working. I assume it is related to changes of font-path variables, hashes, etc. - as mentioned in #1378.
It would be super-cool to keep this compatibility.
The text was updated successfully, but these errors were encountered: