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

Icon not showing (Symbol element missing from SVG) on Error pages #228

Open
JackMarksThomas opened this issue Aug 1, 2024 · 1 comment

Comments

@JackMarksThomas
Copy link

What version of astro-icon are you using?

"^1.1.0"

Astro Info

Astro                    v4.4.2
Node                     v18.19.0
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/netlify
Integrations             @astrojs/tailwind
                         astro-icon
                         @astrojs/alpinejs
                         @sanity/astro
                         astro-robots-txt
                         astro-meta-tags
                         @sentry/astro

If this issue only occurs in one browser, which browser is a problem?

All

Describe the Bug

Astro icons works as expected on all pages, apart from Error pages (400, 500). On these pages I can see that the SVG element is added with the correct <use.../> tag, however the Symbol tag with the svg code inside is missing - as if the astro-icons has identified that it already exists somewhere on the page so can just reference it, but it obviously doesn't...

Interestingly it's working fine locally. And if I use is:inline directive it also works.

What's the expected result?

The first time an icon is used it should render the symbol tag with the svg code, then if it is used again it can be referenced and symbol isn't required.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-3jmjzs?file=package.json&on=stackblitz

@dsijakovski98
Copy link

Same thing happens to me, but for all of the non-home pages.
Like "/" page has all icons available, but let's say "/about" page has some of the icons hidden for some reason.
Can't seem to figure out the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants