gatsbyjs/gatsby · error
Plugin ${plugin.name} called actions.setRequestHeaders with
Error message
Plugin ${plugin.name} called actions.setRequestHeaders with a domain property that isn't a string. What it means
Validation inside actions.setRequestHeaders: the `domain` argument is not a string (undefined, non-string, or malformed). The action warns naming the plugin, because domain-keyed header storage requires exact string domains for later image CDN requests.
Source
Thrown at packages/gatsby/src/redux/actions/public.js:1496
* @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
}
const baseDomain = url.parse(domain)?.hostname
if (baseDomain) {
return {
type: `SET_REQUEST_HEADERS`,
payload: {View on GitHub (pinned to e85d62f177)
Solutions
- Fix the plugin to pass domain as a plain string (e.g. `example.com`)
- Guard the domain value before calling setRequestHeaders
- Update or patch the offending plugin
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/gatsby/src/redux/actions/public.js:1496 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/a532185ab468da58.
Report an issue: GitHub.