{"record":{"id":"2e4d6755babf3783","repo":"vercel/next.js","slug":"page-page-is-missing-exported-function-gener","errorCode":null,"errorMessage":"Page \"${page}\" is missing exported function \"generateStaticParams()\", which is required with \"output: export\" config. See more info here: https://nextjs.org/docs/messages/generate-static-params","messagePattern":"Page \"(.+?)\" is missing exported function \"generateStaticParams\\(\\)\", which is required with \"output: export\" config\\. See more info here: https://nextjs\\.org/docs/messages/generate-static-params","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/dev/next-dev-server.ts","lineNumber":889,"sourceCode":"        return pathsResult\n      } finally {\n        // we don't re-use workers so destroy the used one\n        staticPathsWorker.end()\n      }\n    }\n    const result = this.staticPathsCache.get(pathname)\n\n    const nextInvoke = withCoalescedInvoke(__getStaticPaths)(\n      `staticPaths-${pathname}`,\n      []\n    )\n      .then(async (res) => {\n        const { prerenderedRoutes, fallbackMode: fallback } = res.value\n\n        if (isAppPath) {\n          if (this.nextConfig.output === 'export') {\n            if (!prerenderedRoutes) {\n              throw new Error(\n                `Page \"${page}\" is missing exported function \"generateStaticParams()\", which is required with \"output: export\" config. See more info here: https://nextjs.org/docs/messages/generate-static-params`\n              )\n            }\n\n            if (\n              !prerenderedRoutes.some((item) => item.pathname === urlPathname)\n            ) {\n              throw new Error(\n                `Page \"${page}\" is missing param \"${pathname}\" in \"generateStaticParams()\", which is required with \"output: export\" config.`\n              )\n            }\n          }\n        }\n\n        if (!isAppPath && this.nextConfig.output === 'export') {\n          if (fallback === FallbackMode.BLOCKING_STATIC_RENDER) {\n            throw new Error(\n              'getStaticPaths with \"fallback: blocking\" cannot be used with \"output: export\". See more info here: https://nextjs.org/docs/advanced-features/static-html-export'","sourceCodeStart":871,"sourceCodeEnd":907,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/server/dev/next-dev-server.ts#L871-L907","documentation":"Thrown during static-path resolution in dev when output:'export' is set and an app-directory page does not export generateStaticParams. Static export requires every dynamic segment to be pre-rendered at build time, so Next.js needs the list of params; when prerenderedRoutes is undefined (no generateStaticParams exported), it throws. Triggered in getStaticPaths while coalescing static-path results.","triggerScenarios":"An app-router page (isAppPath true) under output:'export' has a dynamic route segment (e.g. app/blog/[slug]/page.tsx) but exports no generateStaticParams function. res.value.prerenderedRoutes is undefined, hitting the throw at line 889.","commonSituations":"Adding output:'export' to next.config while having dynamic app-router routes. Converting a pages-router project to app router and forgetting generateStaticParams. Newly adding a [param] route after enabling static export.","solutions":["Add an exported async generateStaticParams() to the dynamic page that returns all params to prerender.","If the route should be fully static, provide the single param explicitly.","Remove output:'export' if dynamic/on-demand rendering is actually needed.","Ensure generateStaticParams returns an array of param objects covering every dynamic segment."],"exampleFix":"// before: app/blog/[slug]/page.tsx with output:export, no params\nexport default function Page({ params }: { params: { slug: string } }) {\n  return <h1>{params.slug}</h1>\n}\n\n// after\nexport async function generateStaticParams() {\n  return [{ params: { slug: 'hello' } }, { params: { slug: 'world' } }]\n}\nexport default function Page({ params }: { params: { slug: string } }) {\n  return <h1>{params.slug}</h1>\n}","handlingStrategy":"validation","validationCode":"// Static-analysis guard: every dynamic app route needs generateStaticParams under output:export\nimport fs from 'fs'\nimport path from 'path'\nfunction assertExportDynamicRoutesHaveGSP(appDir: string) {\n  for (const file of fs.readdirSync(appDir, { withFileTypes: true, recursive: true }) as any[]) {\n    if (file.isFile() && /\\[.+\\]/.test(file.parentPath || '') && /\\.(tsx|ts|js|jsx)$/.test(file.name)) {\n      const src = fs.readFileSync(path.join(file.parentPath, file.name), 'utf8')\n      if (/export\\s+default/.test(src) && !/generateStaticParams/.test(src)) {\n        throw new Error(`${file.name}: dynamic route missing generateStaticParams (output:export)`)\n      }\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When enabling output:'export', audit every app-router [param] route.","Keep generateStaticParams in sync with your data source.","Add a CI step that asserts all dynamic routes export params under export mode."],"tags":["static-export","app-router","generate-static-params","config"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}