Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading svg fails when base-href set #707

Open
mtraut opened this issue Jul 7, 2019 · 6 comments
Open

Loading svg fails when base-href set #707

mtraut opened this issue Jul 7, 2019 · 6 comments
Labels
triage New issues

Comments

@mtraut
Copy link

mtraut commented Jul 7, 2019

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?

@notyetspecified
Copy link

Same issue here.
Screenshot from 2019-07-25 17-10-20

@jereckley
Copy link

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" }

@notyetspecified
Copy link

@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/">

@notyetspecified
Copy link

notyetspecified commented Jul 26, 2019

@jereckley @mtraut

This was already fixed on 4.6.1 ionic-team/ionic-framework#18737 (comment)
Just updated the package and it's all working.

Cheers

@jereckley
Copy link

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.

@roGreenRock
Copy link

I am also encountering this issue.

@brandyscarney brandyscarney added the triage New issues label Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New issues
Projects
None yet
Development

No branches or pull requests

5 participants