Skip to main content
Question

Can’t set hyperlink to instance node through plugin API


kentyang

On Figma UI, it’s easy to set a hyperlink to an instance node by right click “Copy/Paste as“ > “Copy link“. However, I got an error when doing the same thing through plugin API.

The document only says “the (target) node cannot be a sublayer of an instance”. But how about target to that exact instance?

I’m wondering why they are inconsistent. Is there any concern behind?

10 replies

kentyang
  • Author
  • 2 replies
  • October 30, 2021

Does anyone know the answer or the mechanics behind? 😐 Or any Figma employee has been looking into this?


Anton_Komyakov

Is there any solution or workaround?
I’ve tried to copy a text with links inside from one TextNode to another.
Though getRangeHyperlink gives a range split, setRangeHyperlink throws exactly the same error “Invalid hyperlink node reference. Hyperlink target node must be a page or a frame” in case the source link type is “NODE”. In case link type is “URL” no error appears.


Anton_Komyakov

Update:
The error appears when target node is ‘InstanceNode’


luiscamino_bmw

This also happens to us when the target node is a Main Component.

Basically the documentation only says “cannot be a sublayer of an instance”.
And the error says “it must be a page or a frame”.

Something’s off.


Michael_Ehrmann

Upvote to fix this bug in the API.


Brian26
  • 2 replies
  • July 14, 2022

Upvote to fix this bug, I really need this fix.
Same issue here Can't set hyperlink to page node with plugin


Magdalena3

Upvote to fix this bug in the API.


Fusato_Alyssa

This is also a problem for links to Sections. It is quickly becoming a major reason why I’m hesitant to switch my organizing structure in Figma from frames to sections.


Sidney
  • 3 replies
  • November 25, 2022

Please fix this bug!


tank666
  • 4871 replies
  • December 9, 2022

Now this should be fixed. See the Plugin API changelog:

figma.com – 22 Nov 22

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