Preview links flicker and 404 when using Next.js middleware in production builds

Hi @adam.young

Welcome to the Prismic community.

I have found this thread that describes what seems to be the same issue.

So If the preview is working entirely on your local host, then the problem must be a configuration of the deployment service you are using.

Can you please list the npm dependencies you use in your local project to ensure that everything is up-to-date? (I personally doubt that the problem is from your code).

Also, can you add some screen recording/screenshots of the error and, if possible, the deployment platform you are using?

You can also check this thread that might help

Looking forward to your reply,
Fares