You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt to use dynamically loaded SVG icons as described in docs with nz-icon
Build for SSR and run locally
App crashes
What is expected?
Icons are loaded
What is actually happening?
Angular is running on http://localhost:4000
Angular is running in development mode. Call enableProdMode() to enable production mode.
/Users/xxx/Documents/yyy/dist/zzz/server/main.js:309464
throw error;
^
Error: [@ant-design/icons-angular]:the icon delete-o does not exist or is not registered.
at IconNotFoundError (/Users/xxx/Documents/yyy/dist/zzz/server/main.js:477160:10)
at /Users/xxx/Documents/yyy/dist/zzz/server/main.js:477315:15
Environment
Info
ng-zorro-antd
13.0.1
Browser
Any
See refactor of changeIcon2 in NzIconDirective 12.1.1:
Hey @nicholasgerard . I've just tried the older version of the nz-icon in the simple skeleton app and I got the same error, because it can't load the SVG on the server-side (the xhr2.XMLHttpRequest throws an error that protocol is unsupported).
Reproduction link
ng-zorro-antd/components/icon/icon.directive.ts
Line 139 in f40aad9
Steps to reproduce
nz-icon
What is expected?
Icons are loaded
What is actually happening?
See refactor of
changeIcon2
inNzIconDirective
12.1.1:ng-zorro-antd/components/icon/icon.directive.ts
Line 139 in f40aad9
It appears this throws the above error when running in a Node environment (e.g. Angular Universal).
The text was updated successfully, but these errors were encountered: