Need a way to find Missing Library components/styles

Incase it helps anyone else, I discovered that the missing style was on a completely different page. So in order to search all pages instead of just the current page, you just need to make one small tweak to the above code snippet — change figma.currentPage. to be figma.root..

3 Likes

The same idea can be used to look for missing components:

  1. Create a new component with the same name as the missing one: make it big with a background color that clashes with your brand colors (for instance, bright pink) and include text that says ‘MISSING COMPONENT’.

  2. After swapping the component, add a little :no_entry: icon in the name (or something similar to indicate there’s an issue with that component).

  3. Now you can easily identify the missing component instances either in the layers panel or directly on the canvas when you see that bright pink rectangle disrupting your beautiful designs. At that point, you can replace the dummy instance with what’s actually supposed to go there.

  4. Delete the dummy component (bright pink is overrated after all).

It’s definitely a brute force, manual process, but it works when all else fails.

1 Like

That’s so smart. It worked for me.

Hey :slight_smile: I’m Tsurit (She) the developer of this plugin. Thank you for this awesome feedback, I’m glad it helps you!

1 Like

you’re welcome ! thanks to you for the plugin !!

I haven’t find a way to fix this issue with components, but with styles you can delete each style and that style group title will be removed.
it still be present as “missing library” however it will not bother when searching for a style

edit - added reply to original poster of code Pete_Lada under this post

Hi @Sam_Walsh wanna check if your console syntax still works on your end. Found your post, and tried it on Figma Desktop App version 116.2.4 but I can’t get anything to select.

Attached screenshot of fresh file with Header1 text style I tried to run the console log search with.

cc tag @Pete_Lada if your console syntax still works on your end for finding missing text styles. Sorry I missed you in first reply post, see above for details and screenshot. Thanks in advance!

make sure you’re searching for the correct thing. looks like you’re searching for an effect style name in your code, where you probably want a text style (textStyleId)

1 Like

Yup, that’s what I missing, thanks @Pete_Lada !

For reference, changed var style = figma.getStyleById(n.effectStyleId); to var style = figma.getStyleById(n.textStyleId);

And variable ID names seem to be:

  • textStyleId for Text
  • effectStyleId for Effects
  • fillStyleId for Color

Thanks so much everyone! Community is giving me ways to hack around Figma’s shortcomings!

Would it be possible to also use this line of code to swap styles with a library style?
What would that code look like? Because I’m not a coder at all :sweat_smile: But that would be very helpful for my use case

Hi @Jesse_S , I’m not much of a coder myself either, sorry!