Same problem with @nuxtjs/prismic. Was working hour ago and now all previews end up with this error:
ERROR Unexpected status code [404] on URL https://[repository].cdn.prismic.io/api/v2/documents/search?[searchParams]
at node_modules/prismic-javascript/dist/prismic-javascript.min.js:1:16437
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Hey @Phil, sorry for late response but I didn’t get any notifications (now fixed, I’ve turned them on) and also had no time to work on this issue. From my experience it’s working for few first times, and after 10 or 20 previews it starts to get this error. I think it could be connected with rate limiting for an account, because it doesn’t matter if I preview locally or on production site.
Unfortunately but after 18hrs previews still doesn’t work. One thing I found out now, is that I get this warning before previously showed error: WARN previewSession function is deprecated in favor of getPreviewResolver function.
Also if I try to manually visit URL that Unexpected status code [404] on URL error gives me I get:
The warning for the getPreviewResolver deprecation shouldn't cause this issue.
So for this error:
The preview token expires once the saved information has been archived or published. The preview token generated is only valid for the information being previewed at that time. This would suggest that your trying to use an old link after the content has been changed.
Are you making sure that your are clearing the cookies when you finished by clicking the ‘X’ button on the preview module to exit the preview? If you forget to do this the cookies might not be cleared and so your web browser can receive old preview data.
Okey, that was the issue. Manually clearing cookies resolved it.
Still, don’t know why this happend when I was clicking preview button every time from prismic app, not using old links.