{
  "id": "nextjs/next-image-unconfigured-hostname",
  "signature": "Error: Invalid src prop on `next/image`, hostname \"example.com\" is not configured under images.remotePatterns",
  "signature_zh": "错误：`next/image` 上的 src prop 无效，主机名 \"example.com\" 未在 images.remotePatterns 中配置",
  "regex": "Error: Invalid src prop on `next/image`, hostname \"([^\"]+)\" is not configured under images\\.remotePatterns",
  "domain": "nextjs",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Next.js Image component requires external image hostnames to be explicitly allowed in next.config.js under images.remotePatterns for security and optimization; otherwise, it throws this error.",
  "root_cause_type": "generic",
  "root_cause_zh": "Next.js 的 Image 组件要求在 next.config.js 的 images.remotePatterns 中明确允许外部图片主机名，以确保安全和优化；否则会抛出此错误。",
  "versions": [
    {
      "version": "Next.js 13.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Next.js 14.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Next.js 14.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "images.domains is deprecated since Next.js 13; images.remotePatterns is the required configuration.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "remotePatterns requires explicit protocol and hostname; wildcards must be in the hostname field, not as a string pattern.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This bypasses optimization but still requires the hostname to be configured for security; the error persists.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add the hostname to next.config.js: 'images: { remotePatterns: [{ protocol: \"https\", hostname: \"example.com\" }] }'",
      "success_rate": 0.95,
      "how": "Add the hostname to next.config.js: 'images: { remotePatterns: [{ protocol: \"https\", hostname: \"example.com\" }] }'",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using Next.js 14+, use the 'images.unoptimized: true' config to disable all image optimization (not recommended for production).",
      "success_rate": 0.9,
      "how": "If using Next.js 14+, use the 'images.unoptimized: true' config to disable all image optimization (not recommended for production).",
      "condition": "",
      "sources": []
    },
    {
      "action": "For multiple hostnames, add each one: 'images: { remotePatterns: [{ protocol: \"https\", hostname: \"example.com\" }, { protocol: \"https\", hostname: \"cdn.example.com\" }] }'",
      "success_rate": 0.95,
      "how": "For multiple hostnames, add each one: 'images: { remotePatterns: [{ protocol: \"https\", hostname: \"example.com\" }, { protocol: \"https\", hostname: \"cdn.example.com\" }] }'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add the hostname to next.config.js: 'images: { remotePatterns: [{ protocol: \"https\", hostname: \"example.com\" }] }'",
    "If using Next.js 14+, use the 'images.unoptimized: true' config to disable all image optimization (not recommended for production).",
    "For multiple hostnames, add each one: 'images: { remotePatterns: [{ protocol: \"https\", hostname: \"example.com\" }, { protocol: \"https\", hostname: \"cdn.example.com\" }] }'"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nextjs.org/docs/app/api-reference/components/image#remotepatterns",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-08-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}