gatsbyjs/gatsby · error

The requested ${fixedDimension} "${fixedDimension === `width

Error message

The requested ${fixedDimension} "${fixedDimension === `width` ? width : height}px" for the image ${filename} was larger than the actual image ${fixedDimension} of ${imgDimensions[fixedDimension]}px. If possible, replace the current image with a larger one.

What it means

Error "The requested ${fixedDimension} "${fixedDimension === `width` ? width : height}px" for the image ${filename} was larger than the actual image ${fixedDimension} of ${imgDimensions[fixedDimension]}px. If possible, replace the current image with a larger one." thrown in gatsbyjs/gatsby.

Source

Thrown at packages/gatsby-plugin-image/src/image-utils.ts:453

  if (!width) {
    if (!height) {
      width = DEFAULT_FIXED_WIDTH
    } else {
      width = Math.round(height * aspectRatio)
    }
  } else if (!height) {
    height = Math.round(width / aspectRatio)
  }

  const originalWidth = width // will use this for presentationWidth, don't want to lose it
  const isTopSizeOverriden =
    imgDimensions.width < width || imgDimensions.height < (height as number)

  // If the image is smaller than requested, warn the user that it's being processed as such
  // print out this message with the necessary information before we overwrite it for sizing
  if (isTopSizeOverriden) {
    const fixedDimension = imgDimensions.width < width ? `width` : `height`
    reporter.warn(`
The requested ${fixedDimension} "${
      fixedDimension === `width` ? width : height
    }px" for the image ${filename} was larger than the actual image ${fixedDimension} of ${
      imgDimensions[fixedDimension]
    }px. If possible, replace the current image with a larger one.`)

    if (fixedDimension === `width`) {
      width = imgDimensions.width
      height = Math.round(width / aspectRatio)
    } else {
      height = imgDimensions.height
      width = height * aspectRatio
    }
  }

  const sizes = densities
    .filter(size => size >= 1) // remove smaller densities because fixed images don't need them
    .map(density => Math.round(density * (width as number)))

View on GitHub (pinned to e85d62f177)

Solutions

  1. Provide a larger source image
  2. Request smaller width/height matching the actual image dimensions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-plugin-image/src/image-utils.ts:453 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/dc9a1ee42a9cacbc. Report an issue: GitHub.