gatsbyjs/gatsby · error
Panicking because nodes appear to be being changed every tim
Error message
Panicking because nodes appear to be being changed every time we run queries. This would cause the site to recompile infinitely. Check custom resolvers to see if they are unconditionally creating or mutating nodes on every query. This may happen if they create nodes with a field that is different every time, such as a timestamp or unique id.
What it means
Error "Panicking because nodes appear to be being changed every time we run queries. This would cause the site to recompile infinitely. Check custom resolvers to see if they are unconditionally creating or mutating nodes on every query. This may happen if they create nodes with a field that is different every time, such as a timestamp or unique id." thrown in gatsbyjs/gatsby.
Source
Thrown at packages/gatsby/src/state-machines/develop/actions.ts:176
export const logError: ActionFunction<IBuildContext, AnyEventObject> = (
_context,
event
) => {
reporter.error(event.data)
}
export const panic: ActionFunction<IBuildContext, AnyEventObject> = (
_context,
event
) => {
reporter.panic(event.data)
}
export const panicBecauseOfInfiniteLoop: ActionFunction<
IBuildContext,
AnyEventObject
> = () => {
reporter.panic(
reporter.stripIndent(`
Panicking because nodes appear to be being changed every time we run queries. This would cause the site to recompile infinitely.
Check custom resolvers to see if they are unconditionally creating or mutating nodes on every query.
This may happen if they create nodes with a field that is different every time, such as a timestamp or unique id.`)
)
}
export const trackRequestedQueryRun = assign<IBuildContext, AnyEventObject>({
pendingQueryRuns: (context, { payload }) => {
const pendingQueryRuns = context.pendingQueryRuns || new Set<string>()
if (payload?.pagePath) {
pendingQueryRuns.add(payload.pagePath)
}
return pendingQueryRuns
},
})
export const clearPendingQueryRuns = assign<IBuildContext>(() => {View on GitHub (pinned to e85d62f177)
Solutions
- Make custom resolvers idempotent: only create/update nodes when data actually changes
- Remove per-query changing fields (timestamps, unique ids) from generated nodes
- Move node creation out of query-time resolvers and into sourceNodes
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/gatsby/src/state-machines/develop/actions.ts:176 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/3b8577ae222882f1.
Report an issue: GitHub.