jacobtyq/export-figma-svg

findAllByValue TypeError

Closed this issue · 4 comments

Hello,

Everything was working fine, but now I get this error, any idea how I can fix? or what is going on

TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at findAllByValue (/export-figma-svg/src/util/utils.js:25:17)
    at /export-figma-svg/src/util/utils.js:33:22
    at Array.reduce (<anonymous>)
    at findAllByValue (/export-figma-svg/src/util/utils.js:25:30)
    at /export-figma-svg/src/util/utils.js:33:22
    at Array.reduce (<anonymous>)
    at findAllByValue (/export-figma-svg/src/util/utils.js:25:30)
    at /export-figma-svg/src/util/utils.js:33:22
    at Array.reduce (<anonymous>)

Message that will be displayed on users' first issue

Figured out the problem. It was an issue in the Figma structure of the component/naming/layers!

Hey @julio8a , could you share how you resolved this issue?

@jacobtyq, there were two SVG paths that were being (grouped) subtracted in Figma. This API doesn't like it when other than SVG path data layers are inside the component. So just have SVG path layers inside the component.

So this didn't work and was giving me the error:
image

Removing the subtract parent layer and just the two paths worked.
image

However, now I have two filled paths on top of each other and the inside of the cloud is not transparent.

to solve this, it's best to ensure the icon is all one path when created or imported from illustrator as one path. Added this info to the icon creation process, so that we build them appropriately to avoid failed action runs.

Hope this helps.