Query unreleased preview documents


we are running Next.js/react and have some middleware to query preview documents before displaying the preview page.

Currently this works fine if the the document has previously been published, but it can't seem to find new unpublished documents (previewing the release of an import).

We are getting the documentId from the preview queryString and using it like Prismic.Predicates.at('document.id', documentId).

Does the query need to be altered for unreleased preview documents?

Hi Allan,

Sorry about the delay in the reply. What you're describing sounds like what you're describing is that the preview script is not added in the 404 page of your application. You'll need to load this here so the website application can access the linkresolver and redirect to the correct page.

We talk about this and other common preview issues here:


This issue has been closed due to inactivity. Flag to reopen.