Next.js Discord

Discord Forum

Upgraded to Nextjs 16, get "connection closed" errors in sitemap.tsx?

Unanswered
Birman posted this in #help-forum
Open in Discord
BirmanOP
Edit: sitemap.ts, not tsx

Hi,

I just upgraded my project from 15 to 16.2.2 and I have a function in my sitemap that counts pages in the DB to calculate how many sitemaps are needed.
But since the upgrade I have these errors in my build log:

Sitemap Index: Error calculating sitemap count: Error: Connection closed.
at ignore-listed frames

I'm using prisma btw. Any ideas why the sitemap can't access the DB? It has enough connections, it worked before, all the static pages prerender fine and then this error hits.

0 Replies