{
  "id": "nextjs/rewrite-destination-not-found",
  "signature": "Error: Rewrite destination '/X' not found. The destination path must be a valid route.",
  "signature_zh": "错误：重写目标 '/X' 未找到。目标路径必须是有效的路由。",
  "regex": "Error: Rewrite destination '.*' not found\\. The destination path must be a valid route\\.",
  "domain": "nextjs",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A rewrite rule in next.config.js points to a destination route that does not exist in the application or is not a valid internal path (e.g., missing file, typo in path).",
  "root_cause_type": "generic",
  "root_cause_zh": "next.config.js 中的重写规则指向一个在应用程序中不存在或不是有效内部路径的目标路由（例如，缺少文件、路径拼写错误）。",
  "versions": [
    {
      "version": "Next.js 13.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Next.js 14.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Next.js 14.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Next.js 15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Trailing slashes do not create a route; the destination must exist as a file or directory. The error persists because the underlying route is still missing.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The error is specifically about the destination, not the source. Modifying the source may change behavior but does not resolve the missing destination.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Rewrites are for internal routes; external URLs require redirects. The error explicitly states the destination must be a valid internal route.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create the missing route file at the destination path. For example, if destination is '/blog/[slug]', create 'app/blog/[slug]/page.tsx'.",
      "success_rate": 0.9,
      "how": "Create the missing route file at the destination path. For example, if destination is '/blog/[slug]', create 'app/blog/[slug]/page.tsx'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Correct the destination path to match an existing route. Check the file structure in the 'app' or 'pages' directory and update next.config.js accordingly.",
      "success_rate": 0.85,
      "how": "Correct the destination path to match an existing route. Check the file structure in the 'app' or 'pages' directory and update next.config.js accordingly.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a redirect instead of a rewrite if the destination is an external URL or a non-existent internal path that should point elsewhere.",
      "success_rate": 0.75,
      "how": "Use a redirect instead of a rewrite if the destination is an external URL or a non-existent internal path that should point elsewhere.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在目标路径创建缺失的路由文件。例如，如果目标是 '/blog/[slug]'，则创建 'app/blog/[slug]/page.tsx'。",
    "更正目标路径以匹配现有路由。检查 'app' 或 'pages' 目录中的文件结构，并相应更新 next.config.js。",
    "如果目标是外部 URL 或不存在的内部路径且应指向其他地方，则使用重定向代替重写。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nextjs.org/docs/app/api-reference/next-config-js/rewrites",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-08-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}