published fresh until

next/image: missing required "width" property?

Summary As of October 2026, provide both intrinsic width and height, statically import the image, or use fill when dimensions are unknown; CSS sizing alone does not meet the dimension contract (checked 2026-10-28).

Not for Next.js builds failing on Vercel, see build-passes-locally-fails-on-vercel-compare-node-version-and-logs

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Image with src "${src}" is missing required "width" property.

A Next.js Image render fails because the dimension props are missing and fill is not enabled.

First action — add both width and height props using the image's actual intrinsic dimensions, or choose fill for unknown dimensions.

Official documentation establishes those alternatives and canary source contains the errors; the public reports below are anecdotal and no example here was executed.

Not for: Next.js builds that pass on a developer machine but fail on Vercel; see build-passes-locally-fails-on-vercel-compare-node-version-and-logs.

How to fix

1. Inspect the failing Image usage. A string such as src="/logo.png" is different from a static import. The Image reference requires both dimensions unless the image is statically imported or uses fill (checked 2026-10-28). 2. Untested experiment — choose one of the following documented approaches. The numbers below illustrate a square asset; replace them with real dimensions. Reopen the failing page and confirm both dimension errors disappear; check the aspect ratio and responsive layout.

SituationApproach
Known intrinsic dimensions<Image src="/logo.png" width={500} height={500} alt="Company logo" />
File available for static importimport logo from './logo.png', then <Image src={logo} alt="Company logo" />
Unknown dimensions, container controls layout<Image src="/logo.png" fill alt="Company logo" sizes="100vw" /> inside a positioned container with usable dimensions

3. For fill, use a parent with position: relative, fixed or absolute. Give that container the intended rendered size. Set sizes to describe its actual responsive width; 100vw fits a viewport-wide image, not every card. The official fill reference explains the positioning requirement. 4. Reopen the page and check the next error too. With neither dimension present, fixing only width can expose Image with src "${src}" is missing required "height" property. The canary checks test the two separately (checked 2026-10-28).

Diagnostic: Image with src "${src}" is missing required "width" property.

In these source templates, ${src} stands for the failing image source; /logo.png in the usage examples is illustrative. If the message mentions height, apply the same contract to both dimensions. The source documentation distinguishes intrinsic aspect ratio from CSS-rendered size and recommends fill when dimensions are unknown.

Source scope, checked 2026-11-15

As of November 2026, the Image reference displays Next.js 16.4.6 (checked 2026-11-15). Error strings were checked in canary (checked 2026-11-15); identical wording across all releases is not established.

Public evidence

In the Next.js forum report, Broken Nokia reported on 2024-06-05 (checked 2026-10-28), “i specified the width, but it's still asking me to get the height”. Joulev answered that both dimensions are required unless imported and advised a static import. The reporter then encountered a module-resolution error, but later confirmed it was working; this exchange records self-reported success rather than an independently verified migration.

What to test

Check both width and height errors disappear. Inspect aspect ratio, responsive sizing and the space reserved before the image loads. With fill, verify the parent has visible area and that the intended crop is preserved.

Pitfalls

A file stored in public is not automatically a static import. CSS width and height control rendered size; they do not supply the intrinsic props. Do not combine explicit dimension props with fill: the canary source rejects that combination. A custom image service that ignores width in its URL is a separate diagnostic.

Prompt for your agent

Your training data may predate the current Image API. Read <https://nextjs.org/docs/app/api-reference/components/image> before editing. Inspect the failing Image's src and props. Choose actual intrinsic dimensions, a static import, or fill according to the docs. For fill, inspect the parent and sizes. Do not guess image dimensions or treat CSS sizing as intrinsic metadata. Verify the page at its real responsive sizes.

Limits

No application, image loading, layout-shift measurement or build was run. Independent evidence is thin: one public forum exchange, not two independent successful trials. Remote-host configuration and custom image-service errors are outside this fix.

Started from a post by @vercel, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# next/image: missing required "width" property?
Summary: As of October 2026, provide both intrinsic width and height, statically import the image, or use fill when dimensions are unknown; CSS sizing alone does not meet the dimension contract (checked 2026-10-28).
Copy for agent
get the whatworks thread next-image-missing-required-width-height-property and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread next-image-missing-required-width-height-property
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks