gatsbyjs/gatsby · error
The node internal.owner field is set automatically by Gatsby
Error message
The node internal.owner field is set automatically by Gatsby and not by plugins
What it means
Thrown by the createNode action when the incoming node already has `internal.owner` set. owner is an internal field that Gatsby assigns automatically from the plugin that created the node; plugins/users must not set it themselves. The node is JSON-stringified via report.error first, then the build panics.
Source
Thrown at packages/gatsby/src/redux/actions/public.js:708
// Ensure the new node has an internals object.
if (!node.internal) {
node.internal = {}
}
// Ensure the new node has a children array.
if (!node.array && !_.isArray(node.children)) {
node.children = []
}
// Ensure the new node has a parent field
if (!node.parent) {
node.parent = null
}
// Tell user not to set the owner name themself.
if (node.internal.owner) {
report.error(JSON.stringify(node, null, 4))
report.panic(
chalk.bold.red(
`The node internal.owner field is set automatically by Gatsby and not by plugins`
)
)
}
const trackParams = {}
// Add the plugin name to the internal object.
if (plugin) {
node.internal.owner = plugin.name
trackParams[`pluginName`] = `${plugin.name}@${plugin.version}`
}
const result = nodeSchema.validate(node)
if (result.error) {
if (!hasErroredBecauseOfNodeValidation.has(result.error.message)) {
const errorObj = {
id: `11467`,View on GitHub (pinned to 8b06340921)
Solutions
- Do not set `internal.owner` in the node you pass to createNode; only set internal.type, internal.content, internal.contentDigest, and (optionally) mediaType.
- If transforming existing nodes, strip internal.owner before re-creating them.
- Build the internal object fresh: { type, contentDigest, content } and let Gatsby add owner.
Example fix
// before
createNode({
id, internal: { type: `Foo`, contentDigest, owner: `my-plugin` },
})
// after
createNode({
id, internal: { type: `Foo`, contentDigest },
}) Defensive patterns
Strategy: validation
Validate before calling
// Strip owner before createNode so Gatsby can set it
const { owner, ...internalRest } = node.internal
if (owner) reporter.warn('internal.owner is auto-set; ignoring provided value')
actions.createNode({ ...node, internal: internalRest }) Type guard
function isCleanInternal(i): i is { type: string; contentDigest: string } {
return i && typeof i.type === 'string' && typeof i.contentDigest === 'string' && !i.owner
} Prevention
- Build internal fresh per node; never forward owner from cached/transformed nodes.
- Only set internal.type, internal.content, internal.contentDigest (and mediaType when relevant).
- Add a lint/test that asserts created nodes do not carry owner.
When it happens
Trigger: A call to actions.createNode with a node object whose `internal.owner` is truthy (set by user/plugin code rather than Gatsby).
Common situations: Copying node objects and re-saving them; a plugin explicitly assigning internal.owner; transforming cached nodes and forwarding the owner field; misunderstanding that owner is bookkeeping, not input.
Related errors
- createNode must be a function, was ${typeof createNode}
- createNode must be a function, was ${typeof createNode}
- No support for arrays not at the end of path
- Plugins creating nodes can not set data on the reserved fiel
- The `id` parameter passed to createNodeId must be a String o
AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13).
Data as JSON: /api/errors/ef270d2a427113f1.
Report an issue: GitHub.