Why is my `dynamic = 'error'` app dir page rendering client side not pre-rendering statically?
Unanswered
Broad-snouted Caiman posted this in #help-forum
Broad-snouted CaimanOP
I have a simple app dir page which is set to
export const dynamic = 'error'. According to the docs (https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic), this means it should render statically (equivalent to getStaticProps). But instead my page is loading as a blank page, then loading the necessary javascript files, and then rendering the app. This results in much worse performance than the pages dir equivalent of getStaticProps. How do I force my app dir page to render like it did in pages dir with getStaticProps?4 Replies
Broad-snouted CaimanOP
I think the docs I linked to are wrong --
export const dynamic = 'error' in the app dir does not appear to enforce the same server-side pre-render behavior of getStaticProps of the pages dirAsian black bear
But instead my page is loading as a blank page, then loading the necessary javascript files, and then rendering the app.
Is this even possible in a server component?
@Asian black bear > But instead my page is loading as a blank page, then loading the necessary javascript files, and then rendering the app.
Is this even possible in a server component?
Broad-snouted CaimanOP
Sure, server components don't necessarily paint to screen. I mean that the page is blank, not that the HTML file served is empty
Asian black bear
This is the part that seemed confusing about a server component:
then loading the necessary javascript files