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

when this happens to us, we go layer by layer to check where the old one is… it takes us so much time! and it can be in a hidden layer so imagine… but once you find the culprit and you delete it, they disappear

1 Like

Same issue. Still waiting for someone from the Figma team to contact me

Hey All, sorry to hear you’re still having trouble!

As stated above, please try using the quick command: Detach deleted variables to quickly get rid of any existing ghost variables as the 1st step:

Last November 2023, we rolled out a fix that should have addressed any other lingering issues, but if you’re still having issues after using the quick command, please submit a bug report to our support team directly via the form here.

1 Like

Figma closed the subject even if it’s totaly not fixed, and no, using “detach deleted variables” with the command bar doesn’t fix this issue. So I open the subject again:

Here the original message:

Hi folks!

I used some components from other files in my project, and even though I removed them, I still see some Variables available in the “Page → Modes”. They are not available anywhere else. It doesn’t affect the project; when I select one, change the page, and then return to it, that mode is selected.

I checked my file, and nothing leads to the other file anymore – no styles, variables, components, etc.

It seems like a bug, and I see some variables pulled from another file, but can I remove it somehow?

image

6 Likes

This bug is very annoying, and is here since almost a year. Could be great to fix it ! :slight_smile:

1 Like

From the knowledge I have, I don’t feel confident enough to give you info that may be relevant, or confirm if this is a bug.

With specific instances like this, it’s best to have a review from our tech quality team – it could be a bug (Figma-wide or limited to your file), but it also could be something within your file that can be quickly adjusted.

Can you please do the following?

  1. Fill out this form – make sure to use the email associated with the Figma account your file is under: https://help.figma.com/hc/en-us/requests/new?ticket_form_id=360001744374
  1. Please share edit access to the file you’re mentioning in this topic with support-share@figma.com (you won’t be charged for this). If you can’t share this, they can still help you as best as they can.

Let me know if you complete the above.

Hello, thank you for your answer !
Sadly, I’m not the only one suffering of this problem. People shared this on the initial subject and it doesn’t seems to be isolated : How to clear “Used variables” that don’t exist in the file anymore?

I will fill the form, thank you

2 Likes

This is legit insane, I just went through all of the history on this bug and have seen its been going on for a year, with zero fix from Figma. When do you plan on actually pushing a fix for a legitimate bug that probably over 150+ people have complained about in forums alone?

2 Likes

OMG please fix this :pray:

2 Likes

I’ve tried deleting everything from the file. All layers, styles, pages and variables. And the “ghosts” are still there.

1 Like

Hi, the fix by Miggi doesn’t work for variables from libraries. I created a file with variables and published it as a library. The library is saved in a project space. I also created another file, saved it to another project space and added the library with the variable collection. I applied some color variables to some rectangles and created an auto layout frame. Spacing variables are also applied on the frame. Then I went back to the library file, deleted all variables, published it. But there are no updates in the other file. I selected the elements and tried to detach the deleted variables. It didn’t work. My assumption: Detaching works with local variables. It doesn’t work with added libraries.

I think it’s not a problem of a corrupted file or related to a specific user flow. It’s simply a bug that needs to be resolved. Unless it worked as expected in your file with connected libraries.

The video starts after the variable collection has been deleted:

3 Likes

I have also reported it to support.

… It gets even worse if you’ve deleted a variable mode. If there are still deleted but attached variables in your file or library, then you also have to struggle with mode conflicts. In my case: I deleted a theming mode. After that I deleted a sizing variable collection (numbers). Since I’m not able to detach all deleted sizing variables – and these are applied to a lot of auto layout frames – I’m still seeing this kind of mode conflicts.

image

My workaround is now to check every component and replacing the deleted sizing variable placeholder with a raw value. Hopefully there will be an update in the near future.

2 Likes

FYI to folks combing through this massive thread looking for a solution: one does not exist. Ghost variables 4evah.

1 Like

This is ridiculous. I can’t delete ghost variables from another file. The fact that I can apply a non-existing variable theme on a frame and it applies the styling changes to child components, despite zero connections between the 2 files, is a bug. It’s been a bug for a year, it needs to be resolved.

Example, I copy a component from one file to another. I remove all variables and references from the other file inside the component. The variable theme still shows up (e.g. light and dark mode). I can apply this theme to any frame despite it not being in the component I added.

EDIT: I found a workaround this time, to clear cache and restart the app. But, that means each component I copy over needs the ability to paste and remove variables at the same time. Otherwise every time I copy over a component requires me to clear cache and restart the app - which logs me out and resets all my preferences.

3 Likes

Hi,

I reported the bug to Figma support.

They’ve replied that the variable detachment is limited to local variables in the file. They will discuss the issue and whether there is a need to extend the command to variables attached from added libraries.

So for the support it’s not a bug.

This seems a kind of odd to me. The more common case is that designers connect variables from added libraries, isn’t it? Especially when we are talking about design systems and (external) ui kits.

2 Likes

Exact same issue. Just making sure this thread gets enough attention

3 Likes

Nightmare, surely a simple fix? Needs prioritising!

1 Like