Prismic Previews are constantly refreshing

Hey everyone,

Our team has been experiencing some unusual behavior with Prismic previews recently.

We have a project that launched not too long ago where previews work perfectly. However, in our newer, in-progress projects, previews are continuously refreshing.

We've come across a few older posts about similar issues, but nothing recent. We've also gone through all the available troubleshooting documentation, but so far, nothing has resolved the problem.

Both of our projects are running on Vercel with Next.js, using @prismicio/client, @prismicio/react, and @prismicio/next.

The project that works:

  • @prismicio/client v^7.3.1

  • @prismicio/react ^2.7.3

  • @prismicio/next ^1.5.0

The other two:

  • @prismicio/client v^7.3.1

  • @prismicio/react ^2.7.3

  • @prismicio/next ^1.7.0 / ^1.5.0

A solution we found was that setting export const fetchCache = 'force-no-store' on a page fixes the issue, however we want to avoid using this in production.

Has anyone else encountered this issue, or does anyone have suggestions on what else we could try?

Thanks,

Brad

Hi @toyfight, could you share the following pieces of code?

  • Your prismicio.ts file, or wherever you are creating your @prismicio/client instance.
  • Your root layout.tsx or _app.tsx file (depending on your Next.js router), or wherever you are using <PrismicPreview>.

You may have already tried this, but could you also delete all of your cookies and try again? Sometimes the Prismic toolbar gets confused when it sees multiple io.prismic.preview cookies.