gatsbyjs/gatsby · error

111005

111005

Error message

gatsby-plugin-image is missing from your project.\nPlease install "gatsby-plugin-image".

What it means

onPreInit probes for gatsby-plugin-image by dynamically importing gatsby-plugin-image/graphql-utils. An import failure means the package is not installed in the project, which gatsby-source-contentful requires for its image GraphQL integration; the catch escalates to a structured panic telling the user to install it.

Source

Thrown at packages/gatsby-source-contentful/src/gatsby-node.js:54

          pluginOptions.accessToken
        )}". Make sure to double check them!`

        throw new Error(errorMessage)
      }
    })

  return undefined
}

export const onPreInit = async (
  { store, reporter, actions },
  pluginOptions
) => {
  // if gatsby-plugin-image is not installed
  try {
    await import(`gatsby-plugin-image/graphql-utils`)
  } catch (err) {
    reporter.panic({
      id: CODES.GatsbyPluginMissing,
      context: {
        sourceMessage: `gatsby-plugin-image is missing from your project.\nPlease install "gatsby-plugin-image".`,
      },
    })
  }

  // if gatsby-plugin-image is not configured
  if (
    !store
      .getState()
      .flattenedPlugins.find(plugin => plugin.name === `gatsby-plugin-image`)
  ) {
    reporter.panic({
      id: CODES.GatsbyPluginMissing,
      context: {
        sourceMessage: `gatsby-plugin-image is missing from your gatsby-config file.\nPlease add "gatsby-plugin-image" to your plugins array.`,
      },

View on GitHub (pinned to e85d62f177)

Solutions

  1. npm install gatsby-plugin-image
  2. Add gatsby-plugin-image to gatsby-config.js plugins
  3. Rebuild after installing the package
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/gatsby-source-contentful/src/gatsby-node.js:54 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/e665f3440087ab08. Report an issue: GitHub.