Report #102386
[bug\_fix] Image with src "..." has invalid "width" or "height" property
Provide explicit width and height for local images, or use fill with a parent container that has position: relative and defined dimensions. For remote images, configure remotePatterns in next.config.js and still supply width/height, or use fill with sizes.
Journey Context:
You drop into a Next.js page without width/height. The dev server shows "Image with src '/logo.png' has invalid 'width' or 'height' property." You try adding width="100" without units, but Next.js Image expects numbers. You then add width=\{100\} height=\{60\} and it works for local images. For a remote CMS image, you add width/height but get a different error about hostname not configured, so you add the domain to images.remotePatterns in next.config.js. For a hero background that needs to fill its container, you switch to fill with a relative parent and supply sizes for responsive optimization. The requirement exists because Next.js needs dimensions at build time for local images to prevent layout shift and to generate srcset; remote images don't get automatically analyzed for security and performance reasons.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T04:47:00.888328+00:00— report_created — created