Skip to main content

Hi,


I have seen something that seems to be a bug in the plugin api,

(or if it’s not, i’d like to know what i’m doing wrong)


with a rectangle node container having a gradient fill, such as this


image


when accessing the getter fills in my code, i get an error message :

Uncaught Error Error: in get_fills: Cannot read properties of undefined (reading 'colorVar') at get_fills (<eval>/VM46947625:23:21)

and the call stack points to where i’m calling figmaNode.fills


I have searched my code for the pattern colorVar to check if I was doing anything funny with that, but it is nowhere there, it seems that the get_fills is the internal getter that gets called when calling .fills


I have a bunch of other rectangle with gradients that all work fine,



(only the one on the left is failing)


i have looked in details to try to isolate what’s unique about the left one, but nothing stands out, the rectangle contains 1 fill only of type gradient, here’s the config of the gradient


image


i didn’t use any color variable as the error message made me believe at first, nor do I have any variable with a similar name in my whole file,


Here is a screenshot of the fill list


image


Let me know if there is more detail i can provide that would help to reproduce.

Thanks

Share the link to the file so anyone can check it.


Here’s a link to the file


the culprit is the item on the left named gradient2


Figma – 15 Apr 24

It looks like this is still a bug in the Plugin API. At the same time, everything is fine in the REST API.


I recommend changing the topic category to Bugs.


ok done, thanks for looking into it


Reply