How to clear “Used variables” that don’t exist in the file anymore?

A fix for this would be much appreciated. Bugs like this overcomplicate the design process for others involved with the project. Designers cannot pass their work on with confidence when the files aren’t clean. Any idea when we can expect a resolution?

This issue has been really bugging me for 6 months. And I did “Detach deleted variable” commend.

It really polluted the design systems file.

1 Like

This is still a problem. For us I believe what the biggest challenge is that we can’t really tell if a mode is a “ghost” ie truly a mode that has no variables being used, or if we really are still using variables from a deleted mode.

Has anyone found success with some sort of linter that can check for variables with deleted modes? Unfortunately we often have to delete / replace modes for a variety of limitations with the variable setup we have today.

I found that a problem is that I run the command for detach all variables and it says 0 instances found / 0 detached. But after digging into the component I find a reference somewhere buried deep into the component.

As an example, I copy a component from our design system library over (not an instance) because I want to experiment with an alternative layout or design. It doesn’t seem to have the problem as of late (maybe the updates fixed it for me), but this was where the issue typically came from.

For instance, I would see the variable modes (light, dark) as an option even know all references to it seemed to be removed. And I could apply that mode and it would work. Maybe it’s fixed now but if I come across the problem again I will mention it.

1 Like

I’m having the same issue.
I have “used” variables in my file that are not local but pulling from an entirely different file that I do not have access to. I would like to remove / detach them but I’m not able to do so after following the above recommendations.

Seems a bit silly to offer this powerful feature of variables but not provide solution for bugs when users have been expressing this issue for a year.

2 Likes

Totally agree. At least provide an option to disconnect those old modes. It also helps to identify and reconnect variables/tokens if the old modes is removed.

3 Likes

I have the same issue and it has not been solved. The quick command to detach deleted variables does not work when using bringing in components for other files or libraries. This is common practice in larger organizations and you end up with a list (often with duplicates) of “Used” variables in your files that are ghosts. Why hasn’t this issue been fully addressed and will it ever? I was hoping the new version would have addressed this… but it’s still there. PLEASE HELP

I am having the same issue. I am making a design system and have rebooted the project a few times but some things got copied over with old variables or variables from other design system component brought into the file. Very frustrating!!

I don’t think “detach deleted variables” does anything. Please help.

How did this help? Does this not just toggle the variables panel open/closed?

This simply does not work. Should I submit a bug or are the hundreds of other folks who submitted bugs enough?