Prismic preview 404 CDN


We are encountering an issue lately with the Preview process. It was working well end suddenly stopped working.

The site is not up to date regarding prismic dependencies, we are using prismic-javascript@2.1.4 et prismic-reactjs@1.1.2. We use the deprecated method Prismic.client().previewSession().

On some pages we get an “Internal Server Error” when trying to access a draft preview. Here is the error message we are getting: "Unexpected status code [404] on URL{"_tracker"%3A"2KX1knSE"%2C""%3A{“preview”%3A""}}&q=[[at(document.type%2C%20"menu")]]”

I took the liberty to remove the name of our actual repository and wrote “repo” in its place. The error stacktrace points to the prismic-javascript library.

Did anything change on Prismic’s side?

Thanks for your help.

Hi Jonas,

Welcome to Prismic community, I will try to help you on this.
I’m checking with our dev team if there has been any changes in the codebase that broke the deprecated Prismic.client().previewSession() .

I will let you know once I have some info,


Hi Fares,

Thank you for your help. I’m looking forward to what you’ll find.

Have a good day.



I have the same problem.

Everything works properly in development, in production already published content works fine but the preview link for unpublished content ends up in a 404 (with the good preview url though…).

Hi Floran,

It sounds like you haven’t got the preview script enabled in your 404 page as well, it needs this to redirect correctly. We discuss this in the preview troubleshooting document:


Hi !

No, it was correctly included. I’ve just solved it !!

In NextJs, you need to have fallback : true in getStaticPaths or it will always render a 404. It doesn’t happen in development because getStaticPath is rerendered every time !


Awesome, I’ll check if we need to update our docs to include this info.

Glad you found your solution @fcosnier.

We are not using getStaticPaths in our project so I doubt that this solution apply to the problem I mentioned earlier. We use getInitialProps to fetch our data as we’re using next@9.1.6.