Plugin Dev: PostMessage not working (The target origin provided ('null') does not match the recipient window's origin)

I working alongside the plugin tutorial and I cannot get PostMessage to work. When I invoke it in ui.html, I get this in the console:
VM248:17 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('null') does not match the recipient window's origin ('https://www.figma.com').
I have searched far and wide and cannot find any other Figma users experiencing this. Any clues on what I should do?

This was my bad - a typo in my postMessage call. I was missing the origin “*”, which should be the last argument of the function:

parent.postMessage( { pluginMessage: { data:data } }, "*" )

1 Like