{
  "id": "nextjs/static-generation-failed-for-dynamic-path",
  "signature": "Error: Static generation failed for path '/[slug]' because 'generateStaticParams' did not return a value for slug '...'",
  "signature_zh": "错误：路径 '/[slug]' 的静态生成失败，因为 'generateStaticParams' 没有为 slug '...' 返回值",
  "regex": "Error: Static generation failed for path '/\\[slug\\]' because 'generateStaticParams' did not return a value for slug",
  "domain": "nextjs",
  "category": "build_error",
  "subcategory": null,
  "root_cause": "The generateStaticParams function is missing or incomplete, so Next.js cannot statically generate pages for dynamic routes during build time.",
  "root_cause_type": "generic",
  "root_cause_zh": "generateStaticParams 函数缺失或不完整，因此 Next.js 在构建时无法为动态路由静态生成页面。",
  "versions": [
    {
      "version": "next@13.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "next@14.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "next@14.2.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The page will be generated for the dummy slug but still fail for other slugs if they are accessed.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This will cause a 404 for any slug not pre-generated, which is not the intended fix.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This changes the application structure and may break existing functionality.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Implement generateStaticParams to return an array of all possible slug values. If the data source is dynamic, use fetch or a database query.",
      "success_rate": 0.85,
      "how": "Implement generateStaticParams to return an array of all possible slug values. If the data source is dynamic, use fetch or a database query.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the number of slugs is too large, use incremental static regeneration (ISR) by adding revalidate to the fetch or page config.",
      "success_rate": 0.75,
      "how": "If the number of slugs is too large, use incremental static regeneration (ISR) by adding revalidate to the fetch or page config.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use dynamic rendering with `export const dynamic = 'force-dynamic'` to skip static generation entirely.",
      "success_rate": 0.9,
      "how": "Use dynamic rendering with `export const dynamic = 'force-dynamic'` to skip static generation entirely.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "实现 generateStaticParams 以返回所有可能的 slug 值数组。如果数据源是动态的，请使用 fetch 或数据库查询。",
    "如果 slug 数量太大，请使用增量静态再生（ISR），在 fetch 或页面配置中添加 revalidate。",
    "使用动态渲染，设置 `export const dynamic = 'force-dynamic'` 以完全跳过静态生成。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nextjs.org/docs/app/api-reference/functions/generate-static-params",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-03-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}