payloadcms/payload

useLivePreview and client side navigation shows wrong data

Closed this issue · 2 comments

Describe the Bug

If you have multiple pages which use useLivePreview and you do client side navigation between them outside of the admin panel. Then you will see the wrong data rendered.

The reproduction code adds one commit to the payload project which just sets up the header with multiple links so that it's easy to reproduce.

Link to the code that reproduces this issue

https://github.com/andershermansen/payload/tree/navigation-use-live-preview-reproduction

Reproduction Steps

  1. Checkout reproduction branch
  2. pnpm dev live-preview
  3. Go to http://localhost:3000/live-preview
  4. Navigate between the pages from the header
  5. See that wrong content is shown, you can also trigger it with some reloading

Which area(s) are affected? (Select all that apply)

Not sure

Environment Info

node v22.19.0
rest of dependencies as in repo

🚀 This is included in version v3.56.0

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.