vercel/next.js · error · Error

Error: you provided query values for

Error message

Error: you provided query values for ${path} which is an auto-exported page. These can not be applied since the page can no longer be re-rendered on the server. To disable auto-export for this page add `getInitialProps`

What it means

Error " Error: you provided query values for ${path} which is an auto-exported page. These can not be applied since the page can no longer be re-rendered on the server. To disable auto-export for this page add `getInitialProps` " thrown in vercel/next.js.

Solutions

  1. Remove the query values for the auto-exported page, or add getInitialProps to disable auto-export.
Defensive patterns

Strategy: validation

When it happens

Trigger: Query values are provided for an auto-exported (statically optimized) page.

Common situations: Passing query params to a page without getInitialProps/getServerSideProps during export.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/66e713be5332f4ac. Report an issue: GitHub.

Appendix: source

Thrown at packages/next/src/export/routes/pages.ts:82

    ...params,
  }

  if (components.getStaticProps && !htmlFilepath.endsWith('.html')) {
    // make sure it ends with .html if the name contains a dot
    htmlFilepath += '.html'
    htmlFilename += '.html'
  }

  let renderResult: RenderResult | undefined

  if (typeof components.Component === 'string') {
    renderResult = RenderResult.fromStatic(
      components.Component,
      HTML_CONTENT_TYPE_HEADER
    )

    if (hasOrigQueryValues) {
      throw new Error(
        `\nError: you provided query values for ${path} which is an auto-exported page. These can not be applied since the page can no longer be re-rendered on the server. To disable auto-export for this page add \`getInitialProps\`\n`
      )
    }
  } else {
    /**
     * This sets environment variable to be used at the time of SSR by head.tsx.
     * Using this from process.env allows targeting SSR by calling
     * `process.env.__NEXT_OPTIMIZE_CSS`.
     */
    if (renderOpts.optimizeCss) {
      process.env.__NEXT_OPTIMIZE_CSS = JSON.stringify(true)
    }
    try {
      renderResult = await lazyRenderPagesPage(
        req,
        res,
        page,
        searchAndDynamicParams,

View on GitHub (pinned to 0eb3775416)