Hi Prismic community!
I try to use Previews within my Next.js & Prismic project. It works on the localhost environment but not in production, where a 404 page – which is constantly reloading – is shown instead of the preview page.
I tried to implement everything as it is described in the documentation and tried to debug by reading in this forum.
Reading the thread Troubleshooting: Previews I found two aspects which were confusing:
-
It describes that the previews script has to be in the head of every page, but it is located in the body of all my pages. Is this also okay?
-
it describes that the preview cookie should look something like this:
https%3A%2F%2Freponame.prismic.io%2Fpreviews%2FXbr_VhAAACMAEdNJ%3AXbr-nBAAACMAEc-_%3FwebsitePreviewId%3DXanozRIAABXZ-ihY&documentId=XbApbxAAACYAP1DJ
...but when I inspect the cookie in the preview it looks like this:
YrRvNBEAACwARCrR~YmAK0xIAACkAGxPJ
Some context info: The project uses
@prismicio/client^6.3.0
@prismicio/next^0.1.2
next^12.1.0
The project is not using slice machine, what makes it a little bit difficult, because all the documentation is based on projects which use slice machine.
I know that there are many more aspects, which could be relevant to figure out what is the reason why my preview does not work yet. Please ask if I should give some specific context info!
I'm very thankful for every help!