gatsbyjs/gatsby · error

Missing StaticImage "src" in ${filename}.

Error message

Missing StaticImage "src" in ${filename}.

What it means

Guard in gatsby-plugin-image's node API: while writing queued images for a source file, an entry's `src` was falsy (the <StaticImage> usage had no resolvable src). The entry is skipped with this warning; the rest of the file's images are still processed.

Source

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

  createNode,
  filename,
}: {
  images: Map<string, IStaticImageProps>
  pathPrefix: string
  cacheDir: string
  reporter: Reporter
  cache: GatsbyCache
  sourceDir: string
  createNodeId: ParentSpanPluginArgs["createNodeId"]
  createNode: Actions["createNode"]
  filename: string
}): Promise<void> {
  const promises = [...images.entries()].map(
    async ([hash, { src, ...args }]) => {
      let file: FileSystemNode | undefined
      let fullPath
      if (!src) {
        reporter.warn(`Missing StaticImage "src" in ${filename}.`)
        return
      }
      if (isRemoteURL(src)) {
        let createRemoteFileNode
        try {
          createRemoteFileNode =
            require(`gatsby-source-filesystem`).createRemoteFileNode
        } catch (e) {
          reporter.panic(`Please install gatsby-source-filesystem`)
        }

        try {
          file = await createRemoteFileNode({
            url: src,
            cache,
            createNode,
            createNodeId,
          })

View on GitHub (pinned to e85d62f177)

Solutions

  1. Make sure every <StaticImage> has a non-empty, statically-evaluable src prop
Defensive patterns

Strategy: validation

When it happens

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