How to fix "Corrupt layer names"

When trying to publish a library component, one component is listed in section “Invalid components” with error message “Corrupt layer names”.

Looking at the component, I can not see anything special about the layer names (like empty names or special characters), that could invalid/corrupt.

Does anyone know what this means and how it can be fixed?
Thank you!

1 Like

Fix corrupted variant errors
You will get a corrupted variant error if any of your variants do not follow this syntax. This can happen if you mistype a property or value, or use an invalid naming structure when converting existing components.

To fix this issue, you’ll need to rename the properties and values of the variant. While it’s possible to rename them using this syntax in the layer name, we recommend renaming properties and values in the right sidebar instead.
https://help.figma.com/hc/en-us/articles/360056440594-Create-and-use-variants#:~:text=Fix%20corrupted%20variant%20errors

Fix conflicted value errors
All variants within the component set will use the same properties and values, but each variant needs to be a unique combination of them.

If any variants have the exact same combination of values, Figma will let you know that there is a conflict. You’ll see this error even if the variants themselves are visually different.

To resolve this issue, you’ll need to add or update the values of the affected variants, so they have a unique combination of values.
https://help.figma.com/hc/en-us/articles/360056440594-Create-and-use-variants#:~:text=Fix%20conflicted%20value%20errors

@tank666 Thanks for pointing out those articles.
Actually I found them before, but they appeared to describe something else because the error messages “Corrupt layer names” is not mentioned at all. But now in retrospect this is the issue which I had:

It turned out the naming of the component itself was wrong, but Figma does not show the full component variant name on the left side.
So it should have been “User=Admin”, but it was only “Admin”. The displayed text is the same though, it’s always just “Admin” – this is what led me to assume the naming was correct.

For those of you that come across this thread because you have encountered the error “These layers have invalid names. Make sure all variant names are of the value Prop=Value,”… What it’s asking you to do is to rename your layer like this:

Property 1=Default

Where “Default” can be whatever you want to name the variant layer.

For example, I had my initial default card which I wanted to call “CTA on Left” and I created a variant I wanted to call “CTA on Right”. Well, I renamed them exactly that, and that is when I got the error. What I should have named the layers is:

Property 1=CTA on Left
Property 1=CTA on Right

When you hit enter, the “Property 1=” goes away on the layer name and you are left with just the name you wanted to give the variant layer.

To avoid this in the future, do NOT rename your variant layers from the left layers panel, but from the right-side properties panel, it will add the code jargon automatically.

Hope that helps someone.

8 Likes