gatsbyjs/gatsby · error

Plugin ${plugin.name} called actions.setRequestHeaders with

Error message

Plugin ${plugin.name} called actions.setRequestHeaders with a headers property that isn't an object.

What it means

Validation inside actions.setRequestHeaders: a plugin stored request headers for a domain but passed a `headers` value that is not a plain object (null, array, string, etc.). The action rejects/ignores the value and warns, naming the offending plugin, since Image CDN request signing requires structured headers.

Source

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

  }
}

/**
 * Stores request headers for a given domain to be later used when making requests for Image CDN (and potentially other features).
 *
 * @param {Object} $0
 * @param {string} $0.domain The domain to store the headers for.
 * @param {Object} $0.headers The headers to store.
 */
actions.setRequestHeaders = ({ domain, headers }, plugin: Plugin) => {
  const headersIsObject =
    typeof headers === `object` && headers !== null && !Array.isArray(headers)

  const noHeaders = !headersIsObject
  const noDomain = typeof domain !== `string`

  if (noHeaders) {
    reporter.warn(
      `Plugin ${plugin.name} called actions.setRequestHeaders with a headers property that isn't an object.`
    )
  }

  if (noDomain) {
    reporter.warn(
      `Plugin ${plugin.name} called actions.setRequestHeaders with a domain property that isn't a string.`
    )
  }

  if (noDomain || noHeaders) {
    reporter.panic(
      `Plugin ${plugin.name} attempted to set request headers with invalid arguments. See above warnings for more info.`
    )

    return null
  }

View on GitHub (pinned to e85d62f177)

Solutions

  1. Fix the plugin to pass headers as a plain object of string key/values
  2. Check the plugin's setRequestHeaders call site for accidental stringified JSON
  3. Update or pin the plugin to a fixed version
Defensive patterns

Strategy: validation

When it happens

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