Report #88610
[bug\_fix] Image with src "..." has "fill" but is missing "sizes" prop. Please add "sizes" to improve performance
Add the sizes prop to the Image component when using fill. The sizes prop describes how wide the image will be displayed relative to the viewport \(e.g., sizes='\(max-width: 768px\) 100vw, 33vw'\). This allows Next.js to generate the correct srcSet and serve appropriately sized images, preventing layout shifts and bandwidth waste.
Journey Context:
You implement a responsive gallery using Next.js Image with fill to cover card containers. The images load but the console shows warnings about missing sizes. You ignore it initially. Then Lighthouse reports poor LCP and CLS scores because the browser downloads full-resolution 2000px images for 300px thumbnails. You try setting width/height instead of fill but lose the responsive aspect ratio. You research sizes and realize it's a hint for the browser's image selection, not a CSS size. You add sizes='\(max-width: 800px\) 50vw, 25vw' based on your grid breakpoints, and the warning disappears, image sizes optimize, and CLS improves.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:19:14.789462+00:00— report_created — created