Dynamic paths and fallback
What you need to know
A finite set of prebuilt dynamic URLs does not necessarily define every valid URL. With Cache Components disabled, dynamicParams controls whether a segment not listed by generateStaticParams may be handled at runtime. Select a policy according to whether the catalog can grow between builds.
By the end, you can: evaluate behavior for new slugs; verify selected configuration.
Strict prebuilt collection (partial page exports)
export const dynamicParams = false;export function generateStaticParams() { return [{ slug: "moss" }, { slug: "fern" }];}Expected behavior (not framework-tested): An unlisted /articles/tide is rejected in this lane, even if a data source later contains tide. The page must still check that listed records exist.
How it works
With dynamicParams true, an unlisted slug can be evaluated when visited; the page must validate the slug and look up a permitted record. Runtime generation is not the same thing as making every route private or always fresh. For eligible static on-demand paths and ISR, follow the versioned static-generation rules: an empty parameter list or explicit force-static is documented for relevant runtime generation scenarios. Do not combine force-static with user-dependent content. With Cache Components enabled, the docs require at least one sample parameter if generateStaticParams is used; route configuration differs. This batch stays in the disabled lane.
On-demand public paths (partial alternate page exports)
export const dynamicParams = true;export const dynamic = "force-static";export const revalidate = 300;export function generateStaticParams() { return []; }Expected behavior (not framework-tested): An eligible public page can be prepared on a first visit and subsequently revalidated. Pair these exports with the validated public article lookup, not cookies or a private page. Exact runtime caching and expiry need testing.
Common mistake
Older Pages Router fallback options are not App Router dynamicParams syntax. Do not assume a new slug is prebuilt because ISR ran. The documented generateStaticParams function is not rerun during ISR, so regeneration of existing content does not refresh the original build-time parameter enumeration. A strict build list requires a new deployment for newly accepted paths; an open list still needs a notFound branch for missing data.
Practice and verification
Use a catalog with moss and fern prepared and tide existing but not listed. Predict all three plus unknown under both policies. Then design a new-deployment test for strict mode and a first-visit/warm-visit test for open mode.
Scope: App Router, proposed Next.js 16.x, Cache Components disabled for these labs. Snippets assume a reviewed TypeScript app and are static examples; framework behavior has not been executed. Exact supported patch and dependency set must be verified before running.
Further reading: Static Params · Segment Config · Cache Migration