-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
SVG don't escape single quotes with url('') in css #15378
Comments
I saw the image above, and I can see that it might cause trouble. There are nested single-quotes within url property. Which means there are three levels of quotes. I think the encoding itself isn't the problem here. I think the problem is that the style that has three level deep quotes is being inlined. Maybe in this case, it can be solved by not inlining the style property. I would like to have some opinions of others and am more than happy to elaborate further. And it would be great if you can provide reproduction as much as you can. |
Thanks for answering me. I can't do this. It is a problem that has occurred since 5.0.0 version. |
If that's the case, can you roll back the version of vite to where your problem doesn't appear and provide that build result? At this point, I can't tell what's wrong and elaborate further. |
This seems to be a limitation with the SVG inlining heuristic as we inline SVGs that contain the Unfortunately I don't think this is something we can fix. If we want to be conservative, we'd have to always base64 it and that isn't best for compression. Maybe we should document the caveats. |
A lot of people seem to encounter this svg inlining problem. I've already came across 3 people out in the wild who got helped by the "double-quote" solution. Until there is a improvement on |
## Summary: Mark noticed that the new @phosphor icons were not showing up in Storybook on Github Pages (`khan.github.com/pereseus`). I tracked it down to a feature introduced in Vite 5 (vitejs/vite#15534), but it seems like it has bugs ([#15378](vitejs/vite#15378) and [#15444](vitejs/vite#15444)). I don't see how we could "quote" the URL as it's handed of to Wonder Blocks which seems to be handling the import correctly. So instead we'll just force Vite to never inline SVGs using Vite's `assetsInlineLimit` (https://vitejs.dev/config/build-options#build-assetsinlinelimit) option. Issue: LEMS-1887 ## Test plan: I haven't tested on GH Pages yet, but I did the following and verified that there are now svg files in the build output folder: ```sh yarn build-storybook ls storybook-static/assets ``` Author: jeremywiebe Reviewers: benchristel, jeremywiebe, mark-fitzgerald Required Reviewers: Approved By: benchristel Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage, ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Extract i18n strings (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald Pull Request URL: #1136
Describe the bug
Hello, I am waiting for the fixes with svg and the conversion of base64. #15271
I installed the last release 5.0.10 and integrated this pull that fixed my problem but It stopped working.
In the next images show how I import icon, how I use icon in tag video importing with URL the CSS, and how to build icon in mode compile.
Thanks very much beforehand for your help.
Describe the bug
I'm using svelte
I'm using vite 5.0.10
The last version vite that broke this 5.0.0
The last version vite that work is 4.5.0
Import the icon in svg

Use in tag div

How build my icon in production

Sorry, I didn't send the link for reproduction because Stackblitz doesn't allow me to reproduce a fine example.
Reproduction
https://no-example.com
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: