gatsbyjs/gatsby · critical
12200
12200
Error message
Tried to create adapter routes for webpack assets but failed. If the issue persists, please open an issue with a reproduction at https://gatsby.dev/bug-report for more help.
What it means
When using a Gatsby adapter (custom hosting integration, e.g. Gatsby Cloud, Firebase, AWS), Gatsby generates routes for webpack assets during the adapter route-creation phase. If the webpackAssets collection is null or undefined at that point, the adapter cannot register static routes for JS/CSS bundles, so it panics with error code 12200.
Source
Thrown at packages/gatsby/src/utils/adapter/manager.ts:486
path: staticQueryResultPath,
pathToFillInPublicDir: staticQueryResultPath,
headers: MUST_REVALIDATE_HEADERS,
})
}
// app-data.json
{
const appDataFilePath = posix.join(`page-data`, `app-data.json`)
addStaticRoute({
path: appDataFilePath,
pathToFillInPublicDir: appDataFilePath,
headers: MUST_REVALIDATE_HEADERS,
})
}
// webpack assets
if (!webpackAssets) {
reporter.panic({
id: `12200`,
context: {},
})
}
for (const asset of webpackAssets) {
addStaticRoute({
path: asset,
pathToFillInPublicDir: asset,
headers: PERMAMENT_CACHING_HEADERS,
})
}
// chunk-map.json
{
const chunkMapFilePath = posix.join(`chunk-map.json`)
addStaticRoute({
path: chunkMapFilePath,View on GitHub (pinned to 8b06340921)
Solutions
- Ensure a full successful `gatsby build` ran before the adapter route creation phase -- check for earlier build errors in the log.
- Update the adapter package and Gatsby core to mutually compatible latest versions.
- Run `gatsby clean` and rebuild from scratch.
- If writing a custom adapter, ensure the build context includes webpackAssets before route creation -- verify the adapter API contract.
Defensive patterns
Strategy: validation
Validate before calling
// Verify webpack assets exist before adapter route creation
function validateWebpackAssetsForAdapter(buildContext) {
if (!buildContext.webpackAssets || !Array.isArray(buildContext.webpackAssets)) {
throw new Error('webpackAssets not populated -- ensure full build ran before adapter routes')
}
if (buildContext.webpackAssets.length === 0) {
console.warn('webpackAssets is empty -- check for earlier build failures')
}
} Type guard
function hasWebpackAssets(ctx) {
return (
typeof ctx === 'object' &&
ctx !== null &&
Array.isArray(ctx.webpackAssets) &&
ctx.webpackAssets.length > 0
)
} Prevention
- Ensure a full successful gatsby build before adapter route creation.
- Keep adapter packages and Gatsby core at compatible versions.
- Run gatsby clean to eliminate stale state.
- Check for earlier errors in the build log that prevented webpack stats collection.
When it happens
Trigger: The webpackAssets variable is falsy when createAdapterRoutes (or equivalent) reaches the webpack-assets loop. This means the build state was not populated with the list of emitted webpack assets -- typically because an earlier build step (webpack compilation / stats extraction) failed or was skipped.
Common situations: Using a custom adapter or gatsby-plugin adapter integration where the build did not produce webpack stats. A build that bypassed or failed the HTML/JS compilation phase. Adapter misconfiguration or version incompatibility between Gatsby core and the adapter package.
Related errors
- something changed in webpack but I don't know what
- Encountered unknown module type: ${module.type}. Please open
- ${err}
- Could not find the file specified in the Link header `${head
- Couldn't find layout component at "${GATSBY_LAYOUT_COMPONENT
AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13).
Data as JSON: /api/errors/1d013357dec48cc6.
Report an issue: GitHub.