Next.js Discord

Discord Forum

How do i disable "Collecting page data" during build?

Unanswered
Golden paper wasp posted this in #help-forum
Open in Discord
Golden paper waspOP
I don't need static rendering. I only need SSR. export const dynamic = 'force-dynamic' does not work.

4 Replies

@Golden paper wasp I don't need static rendering. I only need SSR. `export const dynamic = 'force-dynamic'` does not work.
1. you can't disable collecting page data during build.
2. you can opt specific pages out of static rendering. and export const dynamic = 'force-dynamic' should work, yeah. could you explain how it doesn't work?
@joulev 1. you can't disable collecting page data during build. 2. you can opt specific pages out of static rendering. and `export const dynamic = 'force-dynamic'` should work, yeah. could you explain how it doesn't work?
Golden paper waspOP
there's a POST route handler (app directory). it makes a request to backend service that's not available during build time.

I thought it's strange that despite being POST instead of GET, nextjs still includes the route as static rendering.
i've put export const dynamic = 'force-dynamic' in root layout.tsx, page.tsx that makes these requests to the route handler, as well as the route handler itself.

but, nextjs still does not opt out the route of static rendering
Golden paper waspOP