gatsbyjs/gatsby · error

Calling "createPageDependency" directly from actions in depr

Error message

Calling "createPageDependency" directly from actions in deprecated. Use "createPageDependency" from "gatsby/dist/redux/actions/add-page-dependency".

What it means

A deprecated shim on the actions object: calling actions.createPageDependency directly triggers this console warning. The implementation moved to a dedicated module (gatsby/dist/redux/actions/add-page-dependency) to break import cycles; the call still works but should migrate. This is a generic deprecation sentinel, not a data error.

Source

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

/**
 * Create a dependency between a page and data.
 *
 * @param {Object} $0
 * @param {string} $0.path the path to the page
 * @param {string} $0.nodeId A node ID
 * @param {string} $0.connection A connection type
 * @private
 */
actions.createPageDependency = (
  {
    path,
    nodeId,
    connection,
  }: { path: string, nodeId: string, connection: string },
  plugin: string = ``
) => {
  console.warn(
    `Calling "createPageDependency" directly from actions in deprecated. Use "createPageDependency" from "gatsby/dist/redux/actions/add-page-dependency".`
  )
  return {
    type: `CREATE_COMPONENT_DEPENDENCY`,
    plugin,
    payload: [
      {
        path,
        nodeId,
        connection,
      },
    ],
  }
}

/**
 * Record that a page was visited on the server..
 *

View on GitHub (pinned to e85d62f177)

Solutions

  1. Import createPageDependency from `gatsby/dist/redux/actions/add-page-dependency` instead of destructuring it from actions
  2. Update custom plugins/source plugins making this call
  3. Suppress only after confirming no first-party code calls the deprecated action
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby/src/redux/actions/public.js:1383 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/975c42bcc3ed6681. Report an issue: GitHub.