Next.js Discord

Discord Forum

How to make static page in app router

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
I have this route that is leveraging generateStaticParams and the build output says the page is static

Code can be viewed here: https://github.com/typehero/typehero/blob/fe4564c261ea95dfa726a1f7421758d4bf1eea0c/apps/web/src/app/%5Blocale%5D/aot-2023/wrapped/page.tsx#L14-L24

However, when I view the page it is not static.

Am I doing something wrong here?

https://typehero.dev/aot-2023/wrapped

5 Replies

Asiatic LionOP
i’ll give it a shot, misleading the build logs say static though :lolsob:
Asiatic LionOP
no luck
Broad-snouted Caiman
I'm facing the same issue. I'm using generateStaticParams in NextJS 15 RC. I'd expect the generated pages to be static, but they aren't. adding
export const dynamic = 'force-static'

fixes the issue but feels kinda weird. What am I overlooking?

The page itself does a call to the database directly. Does that somehow disable the (what I thought) static default?