gatsbyjs/gatsby · error
Error executing the GraphQL query inside…
Error message
Error executing the GraphQL query inside gatsby-plugin-sitemap:
What it means
gatsby-plugin-sitemap's onPostBuild runs the configured GraphQL query; a non-empty errors array from the graphql call means the site query failed (schema mismatch, syntax error, missing siteUrl data). The whole errors array is attached to the panic.
Solutions
- Fix the GraphQL error shown in the errors array
- Ensure siteMetadata.siteUrl is set
- Restore/keep the required allSitePage fields if the query was customized
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/gatsby-plugin-sitemap/src/gatsby-node.js:30 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/aec44a288698d84f.
Report an issue: GitHub.
Appendix: source
Thrown at packages/gatsby-plugin-sitemap/src/gatsby-node.js:30
entryLimit,
query,
excludes,
resolveSiteUrl,
resolvePagePath,
resolvePages,
filterPages,
serialize,
}
) => {
const { data: queryRecords, errors } = await graphql(query)
// resolvePages and resolveSiteUrl are allowed to be sync or async. The Promise.resolve handles each possibility
const siteUrl = await Promise.resolve(resolveSiteUrl(queryRecords)).catch(
err => reporter.panic(`${REPORTER_PREFIX} Error resolving Site URL`, err)
)
if (errors) {
reporter.panic(
`Error executing the GraphQL query inside gatsby-plugin-sitemap:\n`,
errors
)
}
const allPages = await Promise.resolve(resolvePages(queryRecords)).catch(
err => reporter.panic(`${REPORTER_PREFIX} Error resolving Pages`, err)
)
if (!Array.isArray(allPages)) {
reporter.panic(
`${REPORTER_PREFIX} The \`resolvePages\` function did not return an array.`
)
}
reporter.verbose(
`${REPORTER_PREFIX} Filtering ${allPages.length} pages based on ${excludes.length} excludes`
)View on GitHub (pinned to e85d62f177)