Summary: any document link used in a rich text field of a slice will break the live preview of that slice.
This looks like a bug to me, but it would be a pretty obvious one so I'm probably missing something.
It can be reproduced using the minimal Next starter GitHub - prismicio-community/nextjs-starter-prismic-minimal-ts: Start a project with Next.js, Prismic, and TypeScript.
Expected behavior:
- create a new project using starter
- enable live previews (lolcalhost)
- edit the homepage doc that gets created during the install
- see the live preview of the RichText default slice in the left column (the one with the text "Welcome to your new website! ...")
What happens instead of step 4:
- an error is shown in the live preview thumbnail of the RichText default slice
- this is a next error in the preview iframe, not a prismic live preview error
- the next error text is: "Error: [PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see prismic-react/messages/missing-link-properties.md at v2.7.3 · prismicio/prismic-react · GitHub"
Diagnosis:
- the error is caused by the document link in the 5th bullet point (the one with the text: "This website has a homepage (pages/index.js) and a dynamic page (pages/[uid].js). The dynamic page will render pages with dynamic URLs, like this one.")
- that is an internal link to the only other document in the install (titled "Another Page")
- removing that link, saving and refreshing the page makes the live preview work again.
- actually, any document link used in a rich text field of a slice will break the live preview of that slice.
- normal links (by URL) do not cause any issues with live preview.
Please advise.
Thanks!