ionicons
ionicons copied to clipboard
Loading svg fails when base-href set
I am using angular 7.2.2 with ionic 4.6.0.
Everything is fine until i prepare my final deployment where base-href is set to some "/context/path/". Everything keeps working except ionicon resolution, still requesting the resources from "/svg/iconname.svg".
Anything i can do beside hardcoding the src myself?
Same issue here.

In angular.json
Change:
, { "glob": "**/*.svg", "input": "node_modules/@ionic/angular/dist/ionic/svg", "output": "./svg" }
To:
{ "glob": "**/*.svg", "input": "node_modules/ionicons/dist/ionicons/svg", "output": "./svg" }
@jereckley
In angular.json
Change:
, { "glob": "**/*.svg", "input": "node_modules/@ionic/angular/dist/ionic/svg", "output": "./svg" }To:{ "glob": "**/*.svg", "input": "node_modules/ionicons/dist/ionicons/svg", "output": "./svg" }
This is not the issue. The icons are in the right place and work on platform builds except browser, i.e. when I have to change the base href from '/' to '/something/'. So the icon source is pointing to https://someurl.com/svg and not https://someurl.com/something/svg
By the way, I'm building using this
ionic build --prod -- --base-href /something/
which results on this on the index.html
<base href="/something/">
@jereckley @mtraut
This was already fixed on 4.6.1 https://github.com/ionic-team/ionic/issues/18737#issuecomment-509634336 Just updated the package and it's all working.
Cheers
Sorry for the confusion... I was on 4.7.0 and I was having the problem and it didn't matter what the base ref was. This was the fix for me. Thanks.
I am also encountering this issue.
This issue has been labeled as help wanted. This label is added to issues that we believe would be good for contributors.
If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.
For a guide on how to create a pull request and test this project locally to see your changes, see our contributing documentation.
Thank you!