Replies: 2 comments
-
I am also encountering an issue where live preview for some reason does not use the url generated by my function and instead uses This started happening after // iframe still renders "http://localhost:3000/undefined"
livePreview: {
url: ({}) => "http://localhost:3000/hello"
} |
Beta Was this translation helpful? Give feedback.
-
This sounds like this issue here (fixed in 3.46) #13035 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When implementing live preview functionality into a global and collection.
This live preview url routes to the draft endpoint that enables draft mode in react
In development mode it works just fine. However, when deploying I get
Uncaught SyntaxError: Failed to execute 'postMessage' on 'Window': Invalid target origin '' in a call to 'postMessage'
So it seems the target origin isn't being added to the live preview functionality. I've tried returning an absolute url from the
url
functionAnd even setting
serverURL: process.env.NEXT_PUBLIC_PAYLOAD_URL || ''
in the payload config and still nothing.I've made sure the env variable exists, entering the docker container nextjs is running on and running
echo $NEXT_PUBLIC_PAYLOAD_URL
outputs the correct url so that isn't the issue...Beta Was this translation helpful? Give feedback.
All reactions