Skip to main content
Solved

Getting typescript error on node.fillStyleId

  • November 26, 2021
  • 2 replies
  • 1374 views

Parad0x

I’m trying to get the style name of the currently selected node.
This is my ts code :

figma.showUI(__html__)

figma.ui.onmessage = msg => {
	if (msg.type === 'show') {
		for (const node of figma.currentPage.selection) {
			console.log(node.fillStyleId)
		}
	}

	figma.closePlugin()
}

and this is the error I’m getting :

code.ts:6:21 - error TS2339: Property 'fillStyleId' does not exist on type 'SceneNode'.
  Property 'fillStyleId' does not exist on type 'SliceNode'.

For me this doesn’t make any sense because I’m able to use node.fillStyleId in code.js file directly.

Best answer by Gleb

View original
This topic has been closed for comments

2 replies

Gleb
  • Power Member
  • 4706 replies
  • Answer
  • November 26, 2021

  • 0 replies
  • December 26, 2021

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


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