gatsbyjs/gatsby · error
10226
10226
Error message
Couldn't find the "${context.themeName}" plugin declared in "${context.configFilePath}".
Tried looking for a local plugin in ${context.pathToLocalTheme}.
Tried looking for an installed package in the following paths:
${context.nodeResolutionPaths.map(potentialLocationPath => ` - ${potentialLocationPath}`).join(`\n`)} What it means
Error "Couldn't find the "${context.themeName}" plugin declared in "${context.configFilePath}". Tried looking for a local plugin in ${context.pathToLocalTheme}. Tried looking for an installed package in the following paths: ${context.nodeResolutionPaths.map(potentialLocationPath => ` - ${potentialLocationPath}`).join(`\n`)}" thrown in gatsbyjs/gatsby.
Source
Thrown at packages/gatsby/src/bootstrap/load-themes/index.ts:63
// only try to look for local theme in main site
// local themes nested in other themes is potential source of problems:
// because those are not hosted by npm, there is potential for multiple
// local themes with same name that do different things and name being
// main identifier that Gatsby uses right now, it's safer not to support it for now.
if (isMainConfig) {
pathToLocalTheme = path.join(rootDir, `plugins`, themeName)
// is a local plugin OR it doesn't exist
try {
const { resolve } = resolvePlugin(themeName, rootDir)
themeDir = resolve
} catch (localErr) {
reporter.panic(`Failed to resolve ${themeName}`, localErr)
}
}
if (!themeDir) {
const nodeResolutionPaths = module.paths.map(p => path.join(p, themeName))
reporter.panic({
id: `10226`,
context: {
themeName,
configFilePath: configFileThatDeclaredTheme,
pathToLocalTheme,
nodeResolutionPaths,
},
})
}
}
const { configModule, configFilePath } = await getConfigFile(
themeDir,
`gatsby-config`
)
const theme:
| IGatsbyConfigInput
| ((options?: Record<string, unknown>) => IGatsbyConfigInput) =View on GitHub (pinned to e85d62f177)
Solutions
- Install the theme package from npm (npm install <themeName>)
- Add the theme as a local plugin under <rootDir>/plugins/<themeName>
- Check the theme name for typos in gatsby-config.js
- Verify the package resolves from one of the listed node resolution paths
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/gatsby/src/bootstrap/load-themes/index.ts:63 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/26bd66002cfe9070.
Report an issue: GitHub.