Solved

Does Live Preview with SSR still function?

  • 28 September 2022
  • 2 replies
  • 109 views

Badge

I am trying to get Live Preview functioning with SSR in NextJS. So far I been consulting these two resources:

I can’t seem to get the site to render preview content, let alone saved but unpublished content. I am not running the github example above but have employed a similar method in my NextJS site.

It is my understanding that for live preview to function it relies on the preview URL containing the necessary parameters to update the Stack object using Stack.livePreviewQuery(context.query). However though I have Live Preview enabled, I only ever see it call my site without adding any querystring, so I’m unsure how this can work.

I do have Live Preview working using the example NextJS repo, but this is based on client-side rendering.

Should SSR still work and is there something I’m perhaps missing?

 

icon

Best answer by Sachin 27 October 2022, 06:44

View original

2 replies

Userlevel 3
Badge

@will I believe we had a similar issue, correct?

Userlevel 2

Hi @Alex , 

Thank you for your patience

The live preview requires Live preview SDK to run on the client side to ensure that the events are attached to the window. In this case, we haven't initialized the SDK on the client side, hence, the page never knew when the page got updated. Once, we initialize it on the client side, the live preview will respond. However, our team is checking the error shared by you and we will update you soon.

Regards,

Sachin. 

Reply