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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck at "Running Design Tokens" #329

Open
awasem opened this issue Mar 17, 2025 · 13 comments
Open

Stuck at "Running Design Tokens" #329

awasem opened this issue Mar 17, 2025 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@awasem
Copy link

awasem commented Mar 17, 2025

I have been working with this file for months, it has always been able to export, I made some changes today and I am stuck after clicking "Export Design Token File" it just spends and says "Running Design Tokens". I can see in the console on the web where it gives errors after running the plugin.

"unhandled promise rejection: TypeError: cannot read property 'name' of undefined"

I am guessing that one of the changes I made is causing the export to fail. I tried undoing any changes, but I am still seeing this error and cannot export. Any idea what could be causing this?

Image

@0m4r
Copy link
Collaborator

0m4r commented Mar 17, 2025

Hi @awasem, thanks for reporting the bug.
I will be taking a look at it.

Is there any chance you can share your figma variable structure?
Or try to describe it to help us replicate the problem?

Thanks - Omar

@awasem
Copy link
Author

awasem commented Mar 17, 2025

Sure I can share anything to help. I am setting up a 3 tier system and only having the issue in the 3rd tier. I was working on the layout section when I first encountered the issue. Here are a couple of screenshots that show what my variables look like. Let me know if I can provide anything else.

Image

Image

@0m4r
Copy link
Collaborator

0m4r commented Mar 18, 2025

@awasem can you also share the plugin setting as well?

@awasem
Copy link
Author

awasem commented Mar 18, 2025

@0m4r
Image

@awasem
Copy link
Author

awasem commented Mar 18, 2025

I should also mention this file is using variables from two other files (tier 1 and tier 2)

@awasem
Copy link
Author

awasem commented Mar 18, 2025

@0m4r my figma file is also a branch

@awasem
Copy link
Author

awasem commented Mar 19, 2025

@0m4r

I can download my fig file locally and send you a copy if that might help in debugging this, is there a way to do this privately so I don't have to zip and post that publicly here?

@0m4r
Copy link
Collaborator

0m4r commented Mar 19, 2025

this is a good idea.
Why don't you put it on a private GitHub repo and add me to it?
I can download it from there.

The other option I was thinking of is this:
clone the design toke repo, run it locally, and add the plug-in in dev mode.
In this way, it should be easier to see what line of code triggers the problem.

The production code error message does not help to identify the part of the code that triggers it.

@awasem
Copy link
Author

awasem commented Mar 19, 2025

@0m4r
Ok great idea, I've added you to a private repo with the fig file in it. I will try the local dev mode option in the meantime. Thank you for the help!

@0m4r
Copy link
Collaborator

0m4r commented Mar 19, 2025

alright, I got the problem.
Apparently, in certain cases, it is not possible to find the mode (maybe when it belongs to an external figma file?)
it is breaking here:
https://github.com/0m4r/design-tokens-329/blob/main/src/utilities/getVariables.ts#L128

one idea is to try replace that line with:

const variableNameWithMode = mode ? `${collection}/${mode?.name}/${variable?.name}` : variableName

and see if it still produces the result you need/expect.

0m4r pushed a commit to 0m4r/design-tokens-329 that referenced this issue Mar 19, 2025
@0m4r
Copy link
Collaborator

0m4r commented Mar 19, 2025

@awasem can you give a try to the code I have updated here:
https://github.com/0m4r/design-tokens-329

The issue is really what I suspected initially, when you reference a figma variable in another figma file (tier-1 and tier-2 in your case I guess) then some information cannot be resolved anymore, thus the error.

If the fix I provided works, I open a PR for @lukasoppermann to review.

Thanks!

@awasem
Copy link
Author

awasem commented Mar 19, 2025

Hi @0m4r this worked thank you!

I tried to make a PR but I got this error
"Pull request creation failed. Validation failed: must be a collaborator" let me know if there is anything else I can do to help. Thanks again.

@0m4r
Copy link
Collaborator

0m4r commented Mar 20, 2025

@awasem #330 is open and ready for review by @lukasoppermann

@0m4r 0m4r self-assigned this Mar 20, 2025
@0m4r 0m4r added the bug Something isn't working label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants