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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG with multi value style property fail #323

Open
SilviaRebelo-Which opened this issue Sep 3, 2021 · 0 comments
Open

SVG with multi value style property fail #323

SilviaRebelo-Which opened this issue Sep 3, 2021 · 0 comments

Comments

@SilviaRebelo-Which
Copy link

Hello 馃憢馃徑

The following error is being triggered when a SVG has multiple values in a single property. In my case I have a SVG file which has two values for the transform property in the style:

Simplified code of SVG for demonstration:

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="13" viewBox="0 0 6 9">
   <g style="transform: translateX(6px) rotate(90deg);"> // <<<<--- Transform with two values
      <path fill="#ffffff" fill-rule="evenodd" d="..."/>
   </g>
</svg>

Error in console:

ERROR in ./assets/icons/icon-chevron-double.svg
Module build failed (from ../node_modules/react-svg-loader/lib/loader.js):
TypeError: Cannot read property '0' of undefined
    at multiplyTransformMatrices (/Users/***/Sites/later-life-care-calculator/node_modules/svgo/plugins/_transforms.js:302:10)
    at Array.reduce (<anonymous>)

If I remove one of the properties, the SVG compiles successfully. Not sure this is a bug or I'm missing some configuration option but couldn't find anything.

@lagunovsky lagunovsky mentioned this issue Oct 16, 2021
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