Skip to content

SVG with multi value style property fail #323

@SilviaRebelo-Which

Description

@SilviaRebelo-Which

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions