YSN Blog

force-dynamic option

October 30, 2023

When I switched to using the App Router, I noticed that static pages were generated during the build process, even for my top page. It wasn't what I intended. To resolve this issue, I discovered the need for the 'force-dynamic' option, as explained in the Next.js documentation.

export const dynamic = "force-dynamic";

By adding this option to the pages, I ensured that they remained dynamic, allowing me to edit posts as necessary.

It became apparent that I need to learn the details of the App Router...