Skip to main content
Question

Setting attributes on Figma Nodes gives console error the very first time

  • February 10, 2023
  • 0 replies
  • 449 views

ayush.kalani

I am seeing a very interesting behavior when applying an attribute to any figma node using my plugin. When I try to set an attribute for a figma node for the very first time, I get the following error- "“Cannot read properties of undefined (reading ‘Buffer’)”

It fails to properly apply the style the first time but any subsequent calls to set the attribute don’t give the same error and everything works properly.

I have seen it happen when changing color of a figma rectangle node and changing text size, line height or weight of text node.

When changing color of the figma rectangle node, this is the error i get the very first time-

PLUGIN: error: “Cannot read properties of undefined (reading ‘Buffer’)”
PLUGIN: error: “FigmaNode::attrib: key: fills.0.color, value: [object Object], name: Rectangle type: RECTANGLE”

Unfortunately, I am not able to share more code because of security reasons but any suggestions or advice is greatly appreciated. Thank you in advance!

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings