Client Live Preview not working, fieldSchema is empty #13598
Unanswered
lsdebianchi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am trying to make client live preview work.
I followed the docs (https://payloadcms.com/docs/live-preview/client) and built the custom listener (using
@payloadcms/live-preview
as I am in Sveltekit).The basics are working. I send the ready signal, and the parent iframe answers. I edit the field in the admin UI and iframe messages are being sent. My client site catches them, and they indeed contain the updated data.
But then the subscribe function from
@payloadcms/live-preview
returns me amergedData
which is always equal to theinitialData
, even if the iframe messages received have new data in them.On my side I see that is the mergeData() step which is not applying the new data. Looking at the source code I see that the result is populated by this fieldSchemas.forEach inside
traverseFields
.I check the
fieldSchemas
I receive at this step and it's indeed empty[ ]
.I am trying to read the source code to try to understand why, but I am out of my depth.
Configs for the given page:
Payload & @payloadcms/live-preview version: 3.50.0
Anyone know what could be the reason for it?
Beta Was this translation helpful? Give feedback.
All reactions