Inline SVGs not rendering and break page
See original GitHub issue🐛 Bug Report
This may be user error, as I feel like this is core enough that it would have already been reported, so I apologize if I waste anyone’s time.
Have you read the Contributing Guidelines on issues?
Yes
To Reproduce
- npx @docusaurus/init@next init my-website classic
- Add the following to the top of mdx.md:
import Mountain from '@site/static/img/undraw_docusaurus_mountain.svg';
A mountain:
<Mountain />
- Go to http://localhost:3000/docs/mdx The page should be broken and the following error should be in the developer panel:
DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('/assetsundraw_docusaurus_mountain-b480421ae597bc5783ec62d605645b24.svg') is not a valid name.
I want to add that I also tried including the svg in an external component file with the same results
Your Environment
This was done with the most recent version of docusaurus
Reproducible Demo
I’m not including a link because the steps to reproduce from scratch are so quick. Hopefully that’s ok!
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Chrome not rendering SVG referenced via <img> element
This happens when refreshing the page and initial page load. I can get the image to show up by "Inspecting Element" then right...
Read more >SVGs not displaying in Chrome (Example) - Treehouse
The file paths are correct, but the SVGs are only displaying broken image icons, and the SVG used for a background image is...
Read more >5 Gotchas You're Gonna Face Getting Inline SVG Into ...
This is a solvable. When you put inline svg within a ng-repeat to show a list of icons, the icons don't render on...
Read more >Solving SVG Animation Issues - Iconify Documentation
Unfortunately, using animations is not that simple. First of all, there are two ways to render SVGs: ... When using inline <svg>, animations...
Read more >Creating Accessible SVGs - Deque Systems
SVG animations must not auto-play for more than five seconds. ... render lighter and faster pages overall (versus inline SVGs) and allow for ......
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
Hmmmm, I didn’t know we had that!
Need to check this next week, but I can confirm I see this webpack loader:
Thank you @slorber !