gatsbyjs/gatsby · error

[gatsby-plugin-image] "generateImageData" was not passed a p

Error message

[gatsby-plugin-image] "generateImageData" was not passed a plugin name

What it means

API-contract guard inside generateImageData: the `pluginName` argument is falsy. It is only used to prefix warnings, so generation proceeds, but subsequent warnings will lack the plugin identifier that tells you which source plugin produced the bad image. Called by source plugins wrapping gatsby-plugin-sharp/gatsby-plugin-image internals.

Source

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

  args = setDefaultDimensions(args)

  let {
    pluginName,
    sourceMetadata,
    generateImageSource,
    layout,
    fit,
    options,
    width,
    height,
    filename,
    reporter = { warn },
    backgroundColor,
    placeholderURL,
  } = args

  if (!pluginName) {
    reporter.warn(
      `[gatsby-plugin-image] "generateImageData" was not passed a plugin name`
    )
  }

  if (typeof generateImageSource !== `function`) {
    throw new Error(`generateImageSource must be a function`)
  }

  if (!sourceMetadata || (!sourceMetadata.width && !sourceMetadata.height)) {
    // No metadata means we let the CDN handle max size etc, aspect ratio etc
    sourceMetadata = {
      width,
      height,
      format: sourceMetadata?.format || formatFromFilename(filename) || `auto`,
    }
  } else if (!sourceMetadata.format) {
    sourceMetadata.format = formatFromFilename(filename)
  }

View on GitHub (pinned to e85d62f177)

Solutions

  1. Pass pluginName (the calling plugin's name) in the generateImageData args
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-plugin-image/src/image-utils.ts:239 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/1fca435f30d9a32a. Report an issue: GitHub.