gatsbyjs/gatsby · error

[Gatsby Slice API] Could not find values in "${filename}${lo

Error message

[Gatsby Slice API] Could not find values in "${filename}${locationInFile}" for the following props at build time: ${unresolvedProps.join(`, `)}

What it means

Babel-time warning from the Slice API static analysis: props on a slice JSX element could not be evaluated at build time (dynamic values). The message includes the file and line:column of the offending element, which is the input at fault.

Source

Thrown at packages/gatsby/src/utils/babel/find-slices.ts:81

        SLICES_PROPS
      ) as { alias: string; allowEmpty?: boolean }

      const { alias: name, allowEmpty = false } = props

      if (unresolvedProps.length) {
        let locationInFile = ``
        if (nodePath.node.loc?.start?.line) {
          locationInFile = `:${nodePath.node.loc.start.line}`
          if (nodePath.node.loc?.start?.column) {
            locationInFile += `:${nodePath.node.loc.start.column + 1}`
          }
        }

        const error = `[Gatsby Slice API] Could not find values in "${filename}${locationInFile}" for the following props at build time: ${unresolvedProps.join(
          `, `
        )}`

        reporter.warn(error)
        return
      }

      if (name) {
        result[name] = mergePreviouslyCollectedSlice(
          { name, allowEmpty },
          result[name]
        )
        hasResults = true
      }
    },
  })

  return hasResults ? result : null
}

View on GitHub (pinned to e85d62f177)

Solutions

  1. Pass the slice's props (e.g. alias) as static string literals in JSX
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby/src/utils/babel/find-slices.ts:81 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/f10a59e3b5a744a8. Report an issue: GitHub.