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

Bad state: SVG did not specify dimensions #1043

Open
higaski opened this issue Feb 25, 2024 · 5 comments
Open

Bad state: SVG did not specify dimensions #1043

higaski opened this issue Feb 25, 2024 · 5 comments

Comments

@higaski
Copy link

higaski commented Feb 25, 2024

I keep getting Bad state: SVG did not specify dimensions errors when using the SVG attached here and I can't wrap my head around why? The SVG clearly contains all the 3 attributes the error message is complaining about?

This is the error in detail

Bad state: SVG did not specify dimensions

The SVG library looks for a `viewBox` or `width` and `height` attribute to determine the viewport boundary of the SVG.  Note that these attributes, as with all SVG attributes, are case sensitive.

And this is the beginning of the SVG data

<svg
   width="271.099mm"
   height="155.14697mm"
   viewBox="0 0 271.099 155.14699"
   version="1.1"
   ...

logo_bricks

@LucaCoduriV
Copy link

same for me

@rajrushilmakkar
Copy link

facing the same issue with this svg
Social-Emotional-Learning

@dnfield
Copy link
Owner

dnfield commented Mar 7, 2024

facing the same issue with this svg

viewBox is case sensitive. Maybe I should lighten this up though since browsers seem to.

@dnfield
Copy link
Owner

dnfield commented Mar 7, 2024

@higaski your example has a couple pattern elements in it that are using not well supported features for this package, and also includes JavaScript which will never work with this package.

It is a bug that we're requiring a viewBox on a pattern that has no width or height, but fixing that won't fix your SVG unfortunately.

@rajrushilmakkar
Copy link

viewBox is case sensitive.

Hi, thanks, changing to viewBox did fix my issue

Maybe I should lighten this up though since browsers seem to.

I think that would be nice. Happy to create a PR @dnfield

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

4 participants