Hey there, I’m getting an error when swapping a component using swapComponent. I’m getting a new component by getNodeById and then swapping. It’s working for some components but others it doesn’t even though they exist and the component node can fetch?
Have you seen this issue before?
figma_app.min.js.br:5 Error: in get_parent: The node (instance sublayer) with id "I13380:55445;12984:28968" does not exist
at InstanceNode.get_parent [as parent] (eval at <anonymous> (eval at createScopedEvaluatorFactory
Example code
const newComponent = figma.getNodeById(replacementNodeId);
if(newComponent) {
instance.swapComponent(newComponent)
}