gatsbyjs/gatsby · error

The requested ${fixedDimension} "${f

Error message

                       The requested ${fixedDimension} "${fixedDimension === `width` ? width : height}px" for a resolutions field for
                       the file ${file.absolutePath}
                       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 a resolutions field for the file ${file.absolutePath} 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-sharp/src/utils.js:86

  }
  if (!width && !height) {
    width = 400
  }

  // if no width is passed, we need to resize the image based on the passed height
  if (!width) {
    width = Math.round(height * aspectRatio)
  }

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

  // If the image is smaller than what's 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 a resolutions field for
                       the file ${file.absolutePath}
                       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
    }
  }

View on GitHub (pinned to e85d62f177)

Solutions

  1. Provide a larger source image
  2. Request smaller dimensions for the fixed/resolutions image
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-plugin-sharp/src/utils.js:86 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/09f2f49a5b3f4d04. Report an issue: GitHub.