lukasoppermann / design-tokens

🎨 Figma plugin to export design tokens to json in an amazon style dictionary compatible format.
https://www.figma.com/community/plugin/888356646278934516/Design-Tokens
MIT License
964 stars 134 forks source link

Variables export not working. #292

Closed UgoJau closed 11 months ago

UgoJau commented 12 months ago

Hello, i'm trying to export variables but it seems to have a problem. Maybe I missed something.

It works when I'm trying with a file and only primitives.

Capture d’écran 2023-11-21 à 10 39 13

but as soon as I try with all it freeze on Export

Capture d’écran 2023-11-21 à 10 40 54

Thanks for your help

lukasoppermann commented 11 months ago

Hey, this can have many reasons. could you open the console (cmd + shift + i) and copy the error message?

There may be a naming issue with one of the tokens on the other collections. Did you try if both of them lead to an error?

reconfine commented 11 months ago

I am having the same problem - have checked and removed special characters from variable and mode names Uncaught TypeError: Cannot read properties of undefined (reading 'value') at <anonymous>:640:22206 at Object.ar (<anonymous>:640:22369) at <anonymous>:640:25707 at Array.map (<anonymous>) at pr (<anonymous>:640:25682) at onSubmit (<anonymous>:650:714) at Object.Te (<anonymous>:2:84110) at $e (<anonymous>:2:84264) at <anonymous>:2:104124 at Dr (<anonymous>:2:104218)

lukasoppermann commented 11 months ago

Can you provide a screenshot of the variable & modes names?

reconfine commented 11 months ago

Only 2 Modes: Light and Dark There are 116 Variables though, so quite difficult to screenshot. i've exported to a json via another plugin - see here tokens.json

lukasoppermann commented 11 months ago

I would guess the percentage % sign is possibly the issue. Yeah, I think this is the issue.

I will look into if we can allow it, but for the interim you could just remove the % sign.

lukasoppermann commented 11 months ago

Should be fixed, reopen if it persists.

reconfine commented 11 months ago

Confirmed fix. Thankyou!