gatsbyjs/gatsby · error
No support for arrays not at the end of path
Error message
No support for arrays not at the end of path
What it means
While validating nested sub-plugins, Gatsby builds a dotted path and collapses terminal array indices to `[]`. A numeric path segment that is NOT the last segment (i.e. an array nested deeper than the end of the path) has no supported string representation, so validation aborts.
Source
Thrown at packages/gatsby/src/bootstrap/load-plugins/validate.ts:271
const resolvedPlugin = resolvePlugin(value, rootDir)
const modulePath = require.resolve(
`${resolvedPlugin.resolve}${entry ? `/${entry}` : ``}`
)
value.modulePath = modulePath
const normalizedPath = helpers.state.path
.map((key, index) => {
// if subplugin is part of an array - swap concrete index key with `[]`
if (
typeof key === `number` &&
Array.isArray(
helpers.state.ancestors[
helpers.state.path.length - index - 1
]
)
) {
if (index !== helpers.state.path.length - 1) {
throw new Error(
`No support for arrays not at the end of path`
)
}
return `[]`
}
return key
})
.join(`.`)
subPluginPaths.add(normalizedPath)
} catch (err) {
console.log(err)
}
return value
})
}, `Gatsby specific subplugin validation`)View on GitHub (pinned to 8b06340921)
Solutions
- Restructure the plugin's `subPluginPaths`/options so any array of sub-plugins is the terminal element of the config path.
- If you do not control the plugin, simplify the config to avoid nested arrays of plugins.
- Report the schema shape to the plugin author; this is a structural limitation, not a typo.
Defensive patterns
Strategy: validation
Validate before calling
// For plugin authors: keep arrays of sub-plugins terminal in the options path.
// Validate your schema so nested arrays of plugins are rejected up front:
const BAD = /\.\d+\.[^.]+$/ // numeric segment not at end
function assertFlatSubplugins(optionPath) {
if (/\.\d+\./.test(optionPath) && !optionPath.endsWith("[]")) {
throw new Error(`Unsupported nested subplugin array at ${optionPath}`)
}
}
Prevention
- Design plugin option schemas so any `plugins` array is the last path segment.
- Document supported sub-plugin shapes to users.
When it happens
Trigger: A plugin whose `options` schema contains a nested array of sub-plugins that itself sits inside another array/object, so the array index appears before the final path key (e.g. `plugins.options.things[0].plugins[0]`).
Common situations: Authoring a plugin that exposes its own `plugins` option structured as arrays-inside-arrays; unusual custom plugin option schemas.
Related errors
- You've passed something other than string to the exclude arr
- Invalid options passed to page Filter function
- Neither "cache" or "getCache" was passed. getCache must be f
- createNodeId must be a function, was ${typeof createNodeId}
- createNode must be a function, was ${typeof createNode}
AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13).
Data as JSON: /api/errors/489def818ad506ab.
Report an issue: GitHub.