Bug: svg icons doesn't work on server.
It should work on server too.
Icon registration is tightly coupled with DOM and depends on document to be available which breaks its compatibility with server platform.
Use svg icons on server platform.
It feels quite normal to have svg icons work on server.
@angular/[email protected]
Nope.
Is it okay to use a library like jsdom to implement this ?
@FadySamirSadek unlikely, since platform-server uses domino see https://github.com/fgnass/domino
@Toxicable Thank you so much , i did not know that will do more research and hopefully do it
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
Error retrieving icon:
ERROR [Error]
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?
Getting the same error as @freezy
I am getting the same error and I am using the latest version of the @angular/material package (5.2.4).
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
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?