Skip to main content
Question

Bug with gradient fills

  • May 6, 2024
  • 4 replies
  • 246 views

Vincent_Huss

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

This topic has been closed for replies.

4 replies

tank666
  • May 6, 2024

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


Vincent_Huss
  • Author
  • Active Member
  • May 6, 2024

Here’s a link to the file

the culprit is the item on the left named gradient2

Figma – 15 Apr 24

tank666
  • May 6, 2024

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.


Vincent_Huss
  • Author
  • Active Member
  • May 7, 2024

ok done, thanks for looking into it