{"record":{"id":"e0aceb8494bf84ef","repo":"vercel/next.js","slug":"image-with-src-src-must-use-width-and-heig","errorCode":null,"errorMessage":"Image with src \"${src}\" must use \"width\" and \"height\" properties or \"layout='fill'\" property.","messagePattern":"Image with src \"(.+?)\" must use \"width\" and \"height\" properties or \"layout='fill'\" property\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/client/legacy/image.tsx","lineNumber":1060,"sourceCode":"    } else if (layout === 'intrinsic') {\n      // <Image src=\"i.png\" width=\"100\" height=\"100\" layout=\"intrinsic\" />\n      wrapperStyle.display = 'inline-block'\n      wrapperStyle.position = 'relative'\n      wrapperStyle.maxWidth = '100%'\n      hasSizer = true\n      sizerStyle.maxWidth = '100%'\n      sizerSvgUrl = `data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27${widthInt}%27%20height=%27${heightInt}%27/%3e`\n    } else if (layout === 'fixed') {\n      // <Image src=\"i.png\" width=\"100\" height=\"100\" layout=\"fixed\" />\n      wrapperStyle.display = 'inline-block'\n      wrapperStyle.position = 'relative'\n      wrapperStyle.width = widthInt\n      wrapperStyle.height = heightInt\n    }\n  } else {\n    // <Image src=\"i.png\" />\n    if (process.env.NODE_ENV !== 'production') {\n      throw new Error(\n        `Image with src \"${src}\" must use \"width\" and \"height\" properties or \"layout='fill'\" property.`\n      )\n    }\n  }\n\n  let imgAttributes: GenImgAttrsResult = {\n    src: emptyDataURL,\n    srcSet: undefined,\n    sizes: undefined,\n  }\n\n  if (isVisible) {\n    imgAttributes = generateImgAttrs({\n      config,\n      src,\n      unoptimized,\n      layout,\n      width: widthInt,","sourceCodeStart":1042,"sourceCodeEnd":1078,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/client/legacy/image.tsx#L1042-L1078","documentation":"The legacy pages-router Image component throws when neither width+height nor layout='fill' is provided for a given src: it must know intrinsic dimensions to build the sizer element and prevent layout shift, so images without sizing info are rejected.","triggerScenarios":"The legacy next/image is missing sizing props.","commonSituations":"Using next/legacy/image without width/height or layout='fill'.","solutions":["Provide width and height props, or use layout='fill' with the legacy next/image."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}