Svg files aren't displayed
See original GitHub issueDescribe the bug SVG images aren’t loading
To Reproduce
/* CSS */
/* image is not displayed */
.png {
background: url('./../assets/test.png') center center no-repeat;
}
/* image displayed */
.svg {
background: url('./../assets/test.svg') center center no-repeat;
}
Expected behavior SVG file should be displayed
Desktop (please complete the following information):
- vue-web-extension version: 1.0.3
- OS: MacOS
- Node.js version: v12.16.1
Additional context I guess solution is to make some changes inside webpack.config.js, but I am not sure about this
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Images in SVG Image tags not showing up in Chrome, but ...
Viewing the SVG in your browser (ie. the .svg file) is fine, because you are not loading it via an <img> . The...
Read more >SVG file not showing - Bugs - Forum | Webflow
They show properly for a couple of seconds and then disappear. The image element is still there, linked to the right file, but...
Read more >SVG image not displaying properly in HTML webpage
Save as optimized SVG. In particular, in Illustrator, don't use "Save as", use File > Export > Export for Screens .... Then select...
Read more >Serve SVG with the Correct Content Type - CSS-Tricks
If you are trying to use SVG like <img src="image.svg"> or as a CSS background-image , and the file is linked to correctly...
Read more >How to Fix Problems with Displaying SVG Images within an ...
How to Fix Problems with Displaying SVG Images within an HTML Image Element · Change the image element to an embed element: <embed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That worked, thank you for support and your awesome project!
Removed at
|svg
from this line:test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
Hum, that’s probably because there is two rules for
.svg
files: https://github.com/Kocal/vue-web-extension/blob/master/template/webpack.config.js#L47-L65 … but I’m not sure.Can you try to remove
|svg
from the 2nd rule?