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?
2 Likes
Does anyone know the answer or the mechanics behind?
Or any Figma employee has been looking into this?
2 Likes
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.
1 Like
Update:
The error appears when target node is ‘InstanceNode’
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.
2 Likes
Upvote to fix this bug in the API.
1 Like