generateStaticParams missing on dynamic route
What this means
Section titled “What this means”Without generateStaticParams(), Next.js does not know which paths exist at build time. Pages are rendered on demand without static optimisations, or simply not built at all if the route cannot fall back to server rendering.
How to fix it
Section titled “How to fix it”Export generateStaticParams() from the route file. It returns an array of param objects matching the route’s dynamic segments.
export async function generateStaticParams() { const posts = await getPosts() return posts.map(post => ({ slug: post.slug }))}
export default async function Page({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params const post = await getPost(slug) return <article><h1>{post.title}</h1></article>}If the route content is fully dynamic — for example, a user-specific dashboard — pre-rendering is not possible. Export force-dynamic instead.
export const dynamic = 'force-dynamic'Verify the fix
Section titled “Verify the fix”Run next build and check the output. Routes with generateStaticParams() appear as ○ (Static) or ● (SSG). Re-run orino audit to clear the flag.