Skip to main content
Question

Getting error "figma_app.min.js.br:5 Error: in set_selection: The node with id "368:20" does not exist"


Dana_Martinelli

Been searching online and not able to hunt down the reason or solution for this error? Anyone can help. Here is my code:

 figma
            .createImageAsync(prop.url)
            .then(async (image: Image) => {
                const { width, height } = await image.getSizeAsync()
                rect.resize(width, height)

                // Set the fill on the rect
                rect.fills = [
                    {
                        type: 'IMAGE',
                        imageHash: image.hash,
                        scaleMode: 'FILL'
                    }
                ]

                //send message to ui to change button label
                console.log('IMAGE MADE!!')

                figma.ui.postMessage({
                    type: 'image-made',
                    message: 'Make another'
                })
This topic has been closed for comments

2 replies

Dana_Martinelli

The image does get rendered to the canvas and everything else seems to work fine.


Dana_Martinelli

I think I solved it. I was creating the rectangle for the fill outside of the promise. I added it within the promise and it seems to have cleared the error. My thought is the rectangle was getting created once and by moving it into the promise, it is getting created each time the promise is fired. Now there is a node for the fill for the second render - this makes sense since I was only getting this error on the second fill event.


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