B3nnyL / figgo

👯‍♀️A cli tool makes your Figma and local design token stay in sync 👯‍♂️
https://github.com/B3nnyL/figgo
MIT License
308 stars 15 forks source link

Figgo crashed if there no typography or color blocks #10

Open hgenru opened 5 years ago

hgenru commented 5 years ago

I trying load default color palette, but the Figgo fails because of there no any typography style. A similar error happens when no colors styles on the page.

image

The error cause on these lines https://github.com/B3nnyL/figgo/blob/f87c1a1379ae41ea3c7219ac753dce127c605dc9/lib/service.ts#L73 https://github.com/B3nnyL/figgo/blob/f87c1a1379ae41ea3c7219ac753dce127c605dc9/lib/service.ts#L109

TypeError: Cannot read property 'children' of undefined
    at Object.<anonymous> (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:151:45)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
TypeError: Cannot read property 'children' of undefined
    at Object.<anonymous> (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:85:47)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
TypeError: Cannot read property 'children' of undefined
    at Object.<anonymous> (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:118:47)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/a.plesovskikh/Work/mercury-front/node_modules/figgo/dist/service.js:4:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
B3nnyL commented 4 years ago

Hello @hgenru, sorry for late response.

Figgo only works for templated Figma board which I showed in readme at this moment. If you want to have your personal template and typography synchronised via Figgo, please consider to add them to your board according to this example board.

I'll add more intuitive message for an empty Figma board instead of throwing error messages soon.