Ion-icon CORS Error


I want to use svg stored on a server. I can’t use the svg with ion-icon because of a CORS Error. Is there a solution?

Access to fetch at ‘…’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled

The solution would be to edit the cors settings in your server to allow it.

Hello, if the SVG Icon is located on a server, you should download it and store it locally in your app. If you still get a CORS error, check if the file path is right.