svg icon registration doesn't work on server platform
See original GitHub issueBug, feature request, or proposal:
Bug: svg icons doesn’t work on server.
What is the expected behavior?
It should work on server too.
What is the current behavior?
Icon registration is tightly coupled with DOM and depends on document
to be available which breaks its compatibility with server platform.
What are the steps to reproduce?
Use svg icons on server platform.
What is the use-case or motivation for changing an existing behavior?
It feels quite normal to have svg icons work on server.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?
Nope.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
When accessing web application images don't load - SVG ...
When accessing Web Application behind BIG-IP, images/icons fail to load on your application even after applying the workaround iRule in KB ...
Read more >angular, unable to dynamically load custom mat-icon with ...
You can register your custom icons as material icons. ... You iterate each item in data result and set input [svgIcon] for mat-icon...
Read more >Solved: SVG Icon not displaying - Microsoft Power BI Community
Solved: I have imported a set of SVG icons into Powerbi, to use as conditional formatting. Added the code to the JSON file,...
Read more >5 Gotchas You're Gonna Face Getting Inline SVG Into ...
Gotcha One: Missing the Target. In order to achieve caching using an external SVG file (you seriously don't want to dump ~1.5kb *...
Read more >Optimising SVG load with Service Worker - Blog - Clicktorelease
This is a legacy post, ported from the old system: Images might be too low quality, code might be outdated, and some links...
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 FreeTop 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
Top GitHub Comments
Is server-side pre-rendering supposed to work? When I register icons, I provide an URL, which I’m pretty sure won’t resolve while pre-rendering, given there’s no server running. I tried nevertheless and I’m getting
for each icon I’m trying to render. Build runs through though (without icons obviously). Looks like the error is triggered here.
Would it be possible to retrieve the files from the file system when
isPlatformServer()
is true so pre-rendering works? Or am I missing something on my side?@FadySamirSadek unlikely, since platform-server uses domino see https://github.com/fgnass/domino