Skip to content

Bug: ERROR Error: Error retrieving icon :github! Http failure response for /icons/github.svg: 0 undefined #4

@esthersoftwaredev

Description

@esthersoftwaredev

Describe the bug

In the blog social icons partial component, adding custom mat icons using path icons/github.svg in the constructor
like so:

		this.iconRegistry.addSvgIcon("github",
			this.sanitizer.bypassSecurityTrustResourceUrl("/icons/github.svg")
		);

resulted in getting this error:

image

Steps to resolve

to avoid it, absolute file path must be used since sources suggested that is a solution for SSR rendered sites

		this.iconRegistry.addSvgIcon("github",
			this.sanitizer.bypassSecurityTrustResourceUrl(`${deployedUrl}icons/github.svg`)
		);

Browsers

No response

Additional context (Is this in dev or production?)

No response

I would be willing to submit a PR to fix this issue

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions