vercel/next.js · error · Error
Image with src "${src}" has both "fill" and "style.height" p
Error message
Image with src "${src}" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified. What it means
Props validation in getImgProps: fill was combined with a style.height other than 100%. As with width, fill images take height from the container, so a non-100% inline height is contradictory and rejected.
Source
Thrown at packages/next/src/shared/lib/get-img-props.ts:503
)
}
if (height) {
throw new Error(
`Image with src "${src}" has both "height" and "fill" properties. Only one should be used.`
)
}
if (style?.position && style.position !== 'absolute') {
throw new Error(
`Image with src "${src}" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.`
)
}
if (style?.width && style.width !== '100%') {
throw new Error(
`Image with src "${src}" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.`
)
}
if (style?.height && style.height !== '100%') {
throw new Error(
`Image with src "${src}" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.`
)
}
} else {
if (typeof widthInt === 'undefined') {
throw new Error(
`Image with src "${src}" is missing required "width" property.`
)
} else if (isNaN(widthInt)) {
throw new Error(
`Image with src "${src}" has invalid "width" property. Expected a numeric value in pixels but received "${width}".`
)
}
if (typeof heightInt === 'undefined') {
throw new Error(
`Image with src "${src}" is missing required "height" property.`
)
} else if (isNaN(heightInt)) {View on GitHub (pinned to 0eb3775416)
Solutions
- Remove style.height when using fill; size the parent container instead.
Defensive patterns
Strategy: validation
When it happens
Trigger: next/image with fill also sets style.height.
Common situations: fill images always use height 100%; custom style.height is rejected.
AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19).
Data as JSON: /api/errors/ec2242d15d665967.
Report an issue: GitHub.