Next.js Discord

Discord Forum

Does using Suspense forces dynamic rendering on Nextjs?

Unanswered
Glaucous-winged Gull posted this in #help-forum
Open in Discord
Glaucous-winged GullOP
I though using Suspense on a server side page.tsx in Nextjs 15 (app dir) forced dynamic rendering. At least that's what I understood from [this](https://www.reddit.com/r/nextjs/comments/16yh4xs/will_nextjs_always_require_database_access_at/) post, however when I tried to implement a Suspense with a database query on the compnent wrapped by suspense, the compliation (npm run build) failed with the usual connection failed error when next tries to prerender a page that tries to connect to a db. So, the question is, should I add export const dynamic = "force-dynamic"; to my page.tsx where I have the componet that makes a prisma query? Or is there a better alternative?

0 Replies