vercel/next.js · error · Error

getStaticPaths is only allowed for dynamic SSG pages and was

Error message

getStaticPaths is only allowed for dynamic SSG pages and was found on '${pathname}'.
Read more: https://nextjs.org/docs/messages/non-dynamic-getstaticpaths-usage

What it means

Guard in renderToHTMLImpl: the page exports getStaticPaths, which enumerates dynamic route params, but the current pathname is not a dynamic route (no [param] segments) so there is nothing to enumerate. getStaticPaths is only meaningful for dynamic SSG pages, so the mismatch is rejected at render time.

Source

Thrown at packages/next/src/server/render.tsx:595

    throw new Error(SSG_GET_INITIAL_PROPS_CONFLICT + ` ${pathname}`)
  }

  if (hasPageGetInitialProps && getServerSideProps) {
    throw new Error(SERVER_PROPS_GET_INIT_PROPS_CONFLICT + ` ${pathname}`)
  }

  if (getServerSideProps && isSSG) {
    throw new Error(SERVER_PROPS_SSG_CONFLICT + ` ${pathname}`)
  }

  if (getServerSideProps && renderOpts.nextConfigOutput === 'export') {
    throw new Error(
      '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`
    )
  }

View on GitHub (pinned to 89d017eac4)

Solutions

  1. Only use `getStaticPaths` on dynamic SSG pages (pages with bracket segments like [id].js) together with `getStaticProps`.
  2. Remove `getStaticPaths` from the non-dynamic page.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/server/render.tsx:597 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/87ee1a9cf5c0d469. Report an issue: GitHub.