gatsbyjs/gatsby · error

[gatsby-plugin-image] Missing image prop

Error message

[gatsby-plugin-image] Missing image prop

What it means

Guard in the GatsbyImage browser component: the memoized component received props without the required `image` prop, so it renders null. In development it warns; in production it silently returns null. The input at fault is the component props object passed by the consuming site.

Source

Thrown at packages/gatsby-plugin-image/src/components/gatsby-image.browser.tsx:242

  return createElement(as, {
    ...wrapperProps,
    style: {
      ...wStyle,
      ...style,
      backgroundColor,
    },
    className: `${wClass}${className ? ` ${className}` : ``}`,
    ref: root,
    dangerouslySetInnerHTML,
    suppressHydrationWarning: true,
  })
}

export const GatsbyImage: FunctionComponent<GatsbyImageProps> = memo(
  function GatsbyImage(props) {
    if (!props.image) {
      if (process.env.NODE_ENV === `development`) {
        console.warn(`[gatsby-plugin-image] Missing image prop`)
      }

      return null
    }

    if (!gatsbyImageIsInstalled() && process.env.NODE_ENV === `development`) {
      console.warn(
        `[gatsby-plugin-image] You're missing out on some cool performance features. Please add "gatsby-plugin-image" to your gatsby-config.js`
      )
    }

    return createElement(GatsbyImageHydrator, props)
  }
)

GatsbyImage.propTypes = propTypes
GatsbyImage.displayName = `GatsbyImage`

View on GitHub (pinned to e85d62f177)

Solutions

  1. Pass the image prop (from getImage() or the file childImageSharp data) to GatsbyImage
  2. Guard rendering until the image data is resolved instead of rendering GatsbyImage unconditionally
  3. Check for typos or undefined variables in the image prop expression
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-plugin-image/src/components/gatsby-image.browser.tsx:242 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/1aa88095686a76df. Report an issue: GitHub.