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

Failed to import SVG containing an <image> element #206

Open
benruehl opened this issue Feb 9, 2024 · 0 comments
Open

Failed to import SVG containing an <image> element #206

benruehl opened this issue Feb 9, 2024 · 0 comments

Comments

@benruehl
Copy link

benruehl commented Feb 9, 2024

What version of astro-icon are you using?

1.1.0

Astro Info

Astro                    v4.3.5
Node                     v18.18.0
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             astro-icon

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

No response

Describe the Bug

Upgraded a project from Astro 3.1.0 to 4.3.5 and astro-icon 0.8.0 to 1.1.0.

When I run astro build I get several errors with this pattern:

# astro build
Failed to import "filename": Unexpected element: <image>

When I run astro dev I get similar errors:

# astro dev
Unable to locate "filename" icon!

The respective files are SVG files that contain at least one <image> element. These image elements contain PNG data encoded as base64 which is totally valid SVG and was working fine before the upgrade.

It seems like it doesn't matter if and how the SVG files are imported. Their pure existence causes the error when astro-icon is installed.

What's the expected result?

Build should run without errors when having SVG files with <image> elements in the src directory. Respective SVG files should be importable and usable as an image src, and should be found by the <Icon> component.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ev9r7b?file=package.json

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

1 participant