You can get this error if you use
this.registerIcon('cart-icon', '/assets/images/icons/cart_icon.svg');
instead of
this.registerIconPath('cart-icon', '/assets/images/icons/cart_icon.svg');
If you use the first, it literally tries to use the URL alone as the innerHtml
property of the containing DIV
and then when it looks for an <svg>
inside it just finds text.
Updating to es-build note:
I ended up running into this when removing svg-inline-loader
during updates to Angular 17 / esbuild and forgot to change to the correct register function!
this.registerIcon('down-arrow', require('!svg-inline-loader?classPrefix!'+'src/assets/images/icons/arrow_white_down.svg'));