Skip to main content
Solved

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

  • September 24, 2024
  • 1 reply
  • 338 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 } }, "*" )

View original
This topic has been closed for replies.

1 reply

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


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