Report #99120
[bug\_fix] Image with src "..." must use "width" and "height" properties or "fill" property
Provide explicit width and height if the image dimensions are known at build time, or use fill=\{true\} \(and position the parent with relative \+ dimensions\) when the image must scale to a container. For remote images, also configure remotePatterns in next.config.js and set a valid sizes attribute when using fill.
Journey Context:
A developer drops an into a Next.js page. The dev server refuses to compile and prints that width and height are required. They know the hero is always 1200x600, so they add width=\{1200\} height=\{600\}. Later they add a CMS-driven thumbnail whose aspect ratio varies; width/height would distort it, so they switch to fill=\{true\} and wrap the image in a div with relative positioning and aspect ratio utilities. They also add remotePatterns for the CMS domain and a sizes attribute for responsive breakpoints. The images now lazy-load, avoid layout shift, and serve optimized formats via Next.js's image optimizer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:35:57.125220+00:00— report_created — created