gatsbyjs/gatsby · error

11324

11324

Error message

Error while creating your page:\n\n${message}

What it means

Thrown by createPage when the page's `context` object contains a reserved field (path, component, componentChunkName, context, id, matchPath, internalComponentName, etc.) AND the context value differs from the page's own value for that field. Code 11324. The reserved field would collide with Gatsby's internal page fields during GraphQL argument construction.

Source

Thrown at packages/gatsby/src/redux/actions/public.js:250

arguments. So you don't need to add the page "path" to the context as it's
already available in GraphQL. If a context field duplicates a field already
used by the page object, this can break functionality within Gatsby so must be
avoided.

Please choose another name for the conflicting fields.

The following fields are used by the page object and should be avoided.

${reservedFields.map(f => `  * "${f}"`).join(`\n`)}

            `
      if (isTestEnv) {
        return error
        // Only error if the context version is different than the page
        // version.  People in v1 often thought that they needed to also pass
        // the path to context for it to be available in GraphQL
      } else if (invalidFields.some(f => page.context[f] !== page[f])) {
        report.panic({
          id: `11324`,
          context: {
            message: error,
          },
        })
      } else {
        if (!hasWarnedForPageComponentInvalidContext.has(page.component)) {
          report.warn(error)
          hasWarnedForPageComponentInvalidContext.add(page.component)
        }
      }
    }
  }

  // Check if a component is set.
  if (!page.component) {
    if (isNotTestEnv) {
      report.panic({

View on GitHub (pinned to 8b06340921)

Solutions

  1. Rename the conflicting context property to something non-reserved (e.g. `pagePath` instead of `path`).
  2. Remove the field from context entirely if Gatsby already provides it (path is already a GraphQL argument).
  3. Check the reservedFields list printed in the error message and avoid all of those names.

Example fix

// before
createPage({ path: `/p/`, component, context: { path: `/p/`, id } })
// after
createPage({ path: `/p/`, component, context: { pagePath: `/p/`, id } })
Defensive patterns

Strategy: validation

Validate before calling

// Strip reserved keys from context before createPage
const RESERVED = ['path','component','componentChunkName','context','id','internalComponentName','matchPath','pluginCreator','pluginCreatorId','owner','updatedAt','children','parent']
const safeContext = Object.fromEntries(
  Object.entries(context).filter(([k]) => !RESERVED.includes(k))
)
actions.createPage({ ...page, context: safeContext })

Prevention

When it happens

Trigger: page.context is an object containing one of the reservedFields; invalidFields.some(f => page.context[f] !== page[f]) is true, meaning the conflicting value is actually different from the page's value (an exact duplicate is downgraded to a warning).

Common situations: A v1-era habit of putting `path` into context for GraphQL access; passing the whole node (including `id`) as context; naming a context property `component` or `internalComponentName`.

Related errors


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/07499b7ba89b50c0. Report an issue: GitHub.