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
@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