Netlify - Prismic communication issue

Hello Prismic community!

I have a problem regarding my app that uses Prismic as a CMS and Netlify to deploy my site. Locally everything works fine but as soon as I deploy the site and start to navigate around I get errors like this in my Next.js ISR handler:

In the end effect my page either works fine, displays a white screen or displays the correct page without CSS

Can this be a Prismic issue or is it rather a Netlify one? I am kind of leaning to thinking it's a Netlify issue but posting here as well just in case. Naturally I posted to Netlify forums as well.

Kind regards and thank you in advance for your help.

Hey there, you might need to review your project's code API configuration and ensure your Netlify environment variables are correctly set up. There's a line at the end of the error that appears as if it were trying to call an invalid document. Is it possible that you might be trying to render a deleted or archived doc?