gatsbyjs/gatsby · error
Could not find function loadNodeContent for plugin ${plugin.
Error message
Could not find function loadNodeContent for plugin ${plugin.name} What it means
The owner plugin was found, but its main module does not export a loadNodeContent function. Plugins that own nodes needing content loading must implement this export so Gatsby can fetch raw content on demand.
Source
Thrown at packages/gatsby/src/utils/nodes.ts:60
if (typeof node.internal.content === `string`) {
return node.internal.content
}
// Load plugin's loader function
const plugin = store
.getState()
.flattenedPlugins.find(plug => plug.name === node.internal.owner)
if (!plugin) {
throw new Error(
`Could not find owner plugin of node for loadNodeContent with owner \`${node.internal.owner}\``
)
}
const { loadNodeContent } = require(plugin.resolve)
if (!loadNodeContent) {
throw new Error(
`Could not find function loadNodeContent for plugin ${plugin.name}`
)
}
const content = await loadNodeContent(node)
node.internal.content = content
return content
}
View on GitHub (pinned to 8b06340921)
Solutions
- Implement and export loadNodeContent in the owning plugin's gatsby-node.js.
- Upgrade the plugin to a version that ships loadNodeContent.
- Set node.internal.content directly at createNode time to bypass lazy loading.
Example fix
// before: plugin creates nodes but exports no loader -> [177]
exports.sourceNodes = ({ actions }) => { actions.createNode({ ...node, internal: { owner: 'my-plugin' } }) }
// after: export loadNodeContent
easync function loadNodeContent(node) { return fs.readFile(node.absolutePath, 'utf8') }
exports.loadNodeContent = loadNodeContent Defensive patterns
Strategy: validation
Validate before calling
function pluginExportsLoadNodeContent(plugin) {
const mod = require(plugin.resolve)
return typeof mod.loadNodeContent === 'function'
} Type guard
function hasLoadNodeContent(mod) { return typeof mod?.loadNodeContent === 'function' } Prevention
- Export loadNodeContent from any plugin whose nodes need lazy content loading.
- Set node.internal.content directly at createNode time when content is cheap to load.
- Pin the source plugin version that ships loadNodeContent.
When it happens
Trigger: A plugin calls createNode for nodes that later require content loading, but the plugin's gatsby-node.js does not export loadNodeContent.
Common situations: Source plugin using createNode but forgetting loadNodeContent; a plugin version that dropped the export; transformer plugin expecting the source plugin to provide it.
Related errors
- Could not find owner plugin of node for loadNodeContent with
- Could not create more nodes. Maximum node count is reached:
- Plugins creating nodes can not set data on the reserved fiel
- Usage of "cache" instance in "onPreInit" API is not supporte
- No worker function found for ${job.name}
AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13).
Data as JSON: /api/errors/1804a3989d3d761a.
Report an issue: GitHub.