Skip to main content
Sonny_Lazuardi_Hermawan
New Member
Mar 1, 2023 9:57 AM UTC
Question

figma.importStyleByKeyAsync throwing Error: Unable to create style

This plugin API was working before, after today’s update we got this error

Error: Unable to create style

Any advice?

This topic has been closed for replies.

24 replies

thomas_TikTok-Design-UX-APAC
Mar 6, 2023 1:06 PM UTC

request return the same key that i used to importStyleByKeyAsync

Yeonhee_Lee
Mar 6, 2023 3:45 PM UTC

I see the same error when I run the plugin against a file I have the editor’s access to. It doesn’t happen if I copy the same file and run the same plugin against as an owner.
Does this bug have anything to do with the authority?

Mar 7, 2023 5:43 AM UTC

I’m using the latest style key return by figma API. Not sure if the backend changes you mentioned affected those style created a few years ago.

The network request was success. I believe it’s the Figma client that throws the error

I’m using https://api.figma.com/v1/files/${file_id} to fetch all the style keys. My guess here it might related to this api returning outdated style keys.

thomas_TikTok-Design-UX-APAC
Mar 7, 2023 7:15 AM UTC

i found that style key get from rest api return is different from getLocalPaintsStyles
that’s why this error happen

thomas_TikTok-Design-UX-APAC
Mar 7, 2023 8:13 AM UTC

yes, if you run getLocalPaintsStyles in lib file,you will find that key is different from https://api.figma.com/v1/files/${file_id}

Alexander_Rodin
Mar 9, 2023 3:24 PM UTC

Hi, any solution for this one? Also ran into the same error

Daniel_Buitrago_Jara
New Member
Mar 13, 2023 11:48 PM UTC

Hi, is there a solution for this issue?

I already confirmed that the style ids where updated (they didn’t change in my case) and it keeps throwing the same error.

James_Yang
Figmate
Figmate
Mar 14, 2023 6:57 PM UTC

Hi all, we plan to roll out a fix for this “Unable to create style” error by the end of day Wednesday March 15. This error primarily comes up for older styles that have been moved to another file.

Alexander_Rodin
Mar 17, 2023 10:32 AM UTC

Still getting the same error. Maybe there is something I need to do with the style in the lib for the fix to work?

Active Member
Mar 17, 2023 2:54 PM UTC

I also can’t load team style by ID.