Skip to main content
John_Tyner
September 24, 2024
Solved

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

  • September 24, 2024
  • 1 reply
  • 739 views

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 topic has been closed for replies.
Best answer by John_Tyner

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 reply

John_Tyner
John_TynerAuthorAnswer
September 24, 2024

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 } }, "*" )