{
  "id": "nextjs/invalid-image-width-attribute",
  "signature": "Error: Invalid width attribute on next/image. The width must be a positive number less than or equal to the image's intrinsic width (1920).",
  "signature_zh": "错误：next/image 上的 width 属性无效。宽度必须为正数且小于或等于图像的原始宽度（1920）。",
  "regex": "Error: Invalid width attribute on next/image\\. The width must be a positive number less than or equal to the image's intrinsic width \\(\\d+\\)\\.",
  "domain": "nextjs",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The next/image component's width prop is set to a value greater than the image's intrinsic width, or is zero/negative. Next.js enforces that width cannot exceed the original image dimensions to prevent upscaling without explicit configuration.",
  "root_cause_type": "generic",
  "root_cause_zh": "next/image 组件的 width 属性设置为大于图像原始宽度的值，或为零/负数。Next.js 强制要求 width 不能超过原始图像尺寸，以防止未经明确配置的放大。",
  "versions": [
    {
      "version": "13.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "14.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "15.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting width to a very large number like 9999 to avoid responsive issues",
      "why_fails": "Next.js validates width against the actual image dimensions. Using a value larger than intrinsic width triggers this error.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Omitting width and height props entirely",
      "why_fails": "next/image requires either width/height or fill prop. Omitting them results in a different error about missing dimensions.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using CSS to override the width after setting it incorrectly",
      "why_fails": "The validation happens at build/render time before CSS is applied. CSS overrides don't prevent the error.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set the width prop to the image's actual intrinsic width or smaller. Use the fill prop with sizes if you need to stretch beyond intrinsic dimensions.",
      "success_rate": 0.95,
      "how": "Set the width prop to the image's actual intrinsic width or smaller. Use the fill prop with sizes if you need to stretch beyond intrinsic dimensions.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the unoptimized prop to bypass Next.js image optimization, which also relaxes dimension validation.",
      "success_rate": 0.7,
      "how": "Use the unoptimized prop to bypass Next.js image optimization, which also relaxes dimension validation.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Set the width prop to the image's actual intrinsic width or smaller. Use the fill prop with sizes if you need to stretch beyond intrinsic dimensions.",
    "Use the unoptimized prop to bypass Next.js image optimization, which also relaxes dimension validation."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://nextjs.org/docs/app/api-reference/components/image#width",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.92,
  "resolvable": "true",
  "first_seen": "2024-04-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}