Preview Resolver 404

Hello, (I don't think this is Next.js specific)

I had previews working locally and in production with my Next.js site for a while now but today they stopped working. Did anything change recently on the Prismic side?

Here relevant code from /api/preview.js:

export default async function preview(request, response) {
  const token = request.query.token
  const documentId = request.query.documentId
  const previewResolver = await Client(request).getPreviewResolver(token, documentId)

  const url = await previewResolver.resolve(linkResolver, '/')
  ^ 💥

{ Error: Unexpected status code [404] on URL https://[repo]} at .../node_modules/prismic-javascript/dist/prismic-javascript.min.js


Hey Jerry,

We are aware of some Preview issues with the updated Next.js kit. We are working hard to get a fix for this.

If we have any updates or need any more info we’ll let you know here.


5 posts were split to a new topic: Preview error (expired token, 404)

@jerry.nummi Can you send me your documentID and the full token in private message so I can test this?

@jerry.nummi Can you send me the code for your project in a zip or with a link to the github in a private message? We’ll try and debug this.

@jerry.nummi Can you tell me if you updated your Next.js version before this issue? Can you also confirm that if it’s not working in both your local and production?


Hey @Phil, Previews are working again. ¯_(ツ)_/¯

Weird haha

Let me know if you see any other issues.