Skip to main content
Answer

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

  • September 24, 2024
  • 1 reply
  • 529 views

John_Tyner

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?

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

This topic has been closed for replies.

1 reply

John_Tyner
  • Author
  • Answer
  • 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 } }, "*" )