You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ui): cross-domain server-side live preview throws postMessage error (#13825)
When using server-side live preview across domains, the initial
`postMessage` to the iframe throws the following error:
```txt
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://your-frontend.com') does not match the recipient window's origin ('https://your-backend.com').
```
This error is misleading, however, as it's thrown even when the iframe's
source exactly matches the post message's `targetOrigin`.
For example:
```ts
recipient.postMessage(message, targetOrigin)
```
The problem is that the initial message is sent before the iframe is
ready to receive it, resulting in the parent window posting to itself.
This is not a problem when the front-end is running on the same server,
but if the recipient changes while initializing, the target origin will
be mismatched.
Worth noting that this is not an issue with client-side live preview.
---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
- https://app.asana.com/0/0/1211376499297320
0 commit comments