gatsbyjs/gatsby · error

Could not find image "${src}" in "${filename}". Looked for $

Error message

Could not find image "${src}" in "${filename}". Looked for ${fullPath}.

What it means

Guard in gatsby-plugin-image's node API: for a local (non-remote) src, path.resolve(sourceDir, src) does not exist on disk, so no file node can be created and that image is skipped with a warning naming the path searched. Remote images that fail earlier get a reporter.error instead.

Source

Thrown at packages/gatsby-plugin-image/src/node-apis/image-processing.ts:127

          reporter.error(`Error loading image ${src}`, err)
          return
        }
        if (
          !file?.internal.mediaType ||
          !supportedTypes.has(file.internal.mediaType)
        ) {
          reporter.error(
            `The file loaded from ${src} is not a valid image type. Found "${
              file?.internal.mediaType || `unknown`
            }"`
          )
          return
        }
      } else {
        fullPath = path.resolve(sourceDir, src)

        if (!fs.existsSync(fullPath)) {
          reporter.warn(
            `Could not find image "${src}" in "${filename}". Looked for ${fullPath}.`
          )
          return
        }

        try {
          const {
            createFileNode,
          } = require(`gatsby-source-filesystem/create-file-node`)

          file = await createFileNode(fullPath, createNodeId, {})
        } catch (e) {
          reporter.panic(`Please install gatsby-source-filesystem`)
        }
      }

      if (!file) {
        reporter.warn(`Could not create node for image ${src}`)

View on GitHub (pinned to e85d62f177)

Solutions

  1. Correct the src path so it resolves relative to the file containing the component
  2. Add the missing image file
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-plugin-image/src/node-apis/image-processing.ts:127 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/1e20eee79d22e02f. Report an issue: GitHub.