Image without dimensions
Why it matters
next/image throws at runtime without width and height (unless fill or a static import); a raw <img> without them shifts the layout when it loads (CLS).
Fix
Set width and height (the intrinsic size), use fill inside a sized container, or import the image statically.
Credit
From the Next.js team
next/image requires width and height (or fill) so the browser can reserve space.
From Google Chrome
web.dev documents that images without dimensions cause layout shift.
References
- Image ComponentNext.js
- Optimize Cumulative Layout Shiftweb.dev
- Image OptimizationNext.js