how to force dynamic pages build
Unanswered
gref9730 posted this in #help-forum
gref9730OP
Hello I have a nextjs 14 app router project and I have several client pages which I need to be build as dynamic and they are being build still as static evenought I have on top of page.ts file "use client" and export const dynamic = "force-dynamic" and its still being build as static... what to do?
7 Replies
Pacific sand lance
i think they are pre-rendered rather than static, only workaround i know is dymamic with {ssr:false}
https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading
https://nextjs.org/docs/pages/building-your-application/optimizing/lazy-loading
Asian black bear
A page that is marked to be client-side cannot be running dynamically. That's an antipattern, anyways. Make the page a conventional server component and it's likely you won't have that issue.
Pacific sand lance
dynamically is used to lazy load component, sure it can be used with client componentscorrect me if i'm wrong but used it frequently to reduce bundle size
Asian black bear
A page that is in the client bundle cannot be dynamically rendered server-side.
Pacific sand lance
um, thought u were talking about next/dynamic
nvm