How do I remove a shared component whose original component is deleted?

I deleted the original of a component but a reference to it remains in the Assets panel under “Used in this file”.

1 Like

When you delete a component, it doesn’t detach its instances. So if you still have an instance of that component in the file, it will be shown in the “used in this file” section. You can find instances in the file using plugins like Instance Finder (however I’m not sure if it works when you can’t find one of the instances yourself).

2 Likes

Thanks for the response, Gleb. Yeah I’d tried the Instance Finder route but your instincts are correct. It seems you need to be able to find an instance in the file before the plugin can locate a match.

1 Like

You can also find objects by name, so if you know the name of the component it shouldn’t be hard. Plugins like Search & Focus, Find and Focus, Butler, Figma Walker can do that.

Thanks again! Unfortunately none of those plugins were able to narrow down the instance. Through trial and error (deleting various components in which the ghost-components were likely to have been nested) I was able to narrow down the instance that was causing the problems. By deleting that master component, I can see that the broken links are deleted along with it. So I’ll simply rebuild that component, relink all references to the new one, and delete the problematic one. Thanks for your help, Gleb.

7 Likes

I had the same problem
I used “Figma Finder” plugin
Searched the name, the plugin will return a list of components and instances containing that phrase.
The component will be located on the file by clicking on each item of the list. Then you can either delete it or choose to detach the instance.

2 Likes

It could also be a refresh problem. Just refresh the page.

1 Like

Ok so I had a very similar if not exactly the same issue today and I think I know what caused it and how to fix it.

Cause
My file encountered an issue while I tried to merge branches. The resulting file was incomplete So I “copy/pasted” missing components from the “archived” branch into the main file. The file now references a “read-only node” from the “archived” branch of itself resulting in this paradox state where you have 2 copies of the same components in the same file (probably a bug Figma team). A normal functional one and another you can’t interact with.

Refreshing the window won’t work. Restarting Figma won’t work. And you can’t delete the components.

Work-around
Publish a component Library to your team from the buggy file. This will trigger something really weird behavior: you will get a component update notification to-and-from that same file. Allow the updates, this will clear some of the duplicate components and the remaining ones will now be eligible to be replaced with their local counterparts severing the link to the read-only file. It still won’t label these components as being from an outside file but just replace them with themselves using the swap instance menu. Then unpublish the library and everything should be fine.

I suspect you could get the same result by making a local copy of the file and re-uploading it back to your org but I have not tried it yet.