vercel/next.js · error · Error
getStaticPaths is required for dynamic SSG pages and is miss
Error message
getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.
Read more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value What it means
Guard in renderToHTMLImpl: the page is SSG with a dynamic pathname (contains [param] segments) but exports no getStaticPaths, so Next.js has no way to know which paths to prerender. The combination dynamic+SSG requires getStaticPaths to enumerate params, and its absence is rejected before rendering.
Source
Thrown at packages/next/src/server/render.tsx:608
'getServerSideProps cannot be used with "output: export". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'
)
}
if (getStaticPaths && !pageIsDynamic) {
throw new Error(
`getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.` +
`\nRead more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage`
)
}
if (!!getStaticPaths && !isSSG) {
throw new Error(
`getStaticPaths was added without a getStaticProps in ${pathname}. Without getStaticProps, getStaticPaths does nothing`
)
}
if (isSSG && pageIsDynamic && !getStaticPaths) {
throw new Error(
`getStaticPaths is required for dynamic SSG pages and is missing for '${pathname}'.` +
`\nRead more: https://nextjs.org/docs/messages/invalid-getstaticpaths-value`
)
}
let asPath: string = renderOpts.resolvedAsPath || (req.url as string)
if (process.env.__NEXT_DEV_SERVER) {
const { isValidElementType } =
require('next/dist/compiled/react-is') as typeof import('next/dist/compiled/react-is')
if (!isValidElementType(Component)) {
throw new Error(
`The default export is not a React Component in page: "${pathname}"`
)
}
if (!isValidElementType(App)) {
throw new Error(View on GitHub (pinned to 89d017eac4)
Solutions
- Add `getStaticPaths` to the dynamic page that uses `getStaticProps`, returning the paths to pre-render and a `fallback` value.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/next/src/server/render.tsx:610 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of vercel/next.js@89d017eac4 (2026-08-19).
Data as JSON: /api/errors/8cd03ab8875d34e5.
Report an issue: GitHub.