{"record":{"id":"3b8577ae222882f1","repo":"gatsbyjs/gatsby","slug":"panicking-because-nodes-appear-to-be-being-changed-3b8577","errorCode":null,"errorMessage":"Panicking because nodes appear to be being changed every time we run queries. This would cause the site to recompile infinitely.\nCheck custom resolvers to see if they are unconditionally creating or mutating nodes on every query.\nThis may happen if they create nodes with a field that is different every time, such as a timestamp or unique id.","messagePattern":"Panicking because nodes appear to be being changed every time we run queries\\. This would cause the site to recompile infinitely\\.\nCheck custom resolvers to see if they are unconditionally creating or mutating nodes on every query\\.\nThis may happen if they create nodes with a field that is different every time, such as a timestamp or unique id\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/state-machines/develop/actions.ts","lineNumber":176,"sourceCode":"export const logError: ActionFunction<IBuildContext, AnyEventObject> = (\n  _context,\n  event\n) => {\n  reporter.error(event.data)\n}\n\nexport const panic: ActionFunction<IBuildContext, AnyEventObject> = (\n  _context,\n  event\n) => {\n  reporter.panic(event.data)\n}\n\nexport const panicBecauseOfInfiniteLoop: ActionFunction<\n  IBuildContext,\n  AnyEventObject\n> = () => {\n  reporter.panic(\n    reporter.stripIndent(`\n  Panicking because nodes appear to be being changed every time we run queries. This would cause the site to recompile infinitely.\n  Check custom resolvers to see if they are unconditionally creating or mutating nodes on every query.\n  This may happen if they create nodes with a field that is different every time, such as a timestamp or unique id.`)\n  )\n}\n\nexport const trackRequestedQueryRun = assign<IBuildContext, AnyEventObject>({\n  pendingQueryRuns: (context, { payload }) => {\n    const pendingQueryRuns = context.pendingQueryRuns || new Set<string>()\n    if (payload?.pagePath) {\n      pendingQueryRuns.add(payload.pagePath)\n    }\n    return pendingQueryRuns\n  },\n})\n\nexport const clearPendingQueryRuns = assign<IBuildContext>(() => {","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/state-machines/develop/actions.ts#L158-L194","documentation":"Error \"Panicking because nodes appear to be being changed every time we run queries. This would cause the site to recompile infinitely.\nCheck custom resolvers to see if they are unconditionally creating or mutating nodes on every query.\nThis 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.","triggerScenarios":"Thrown at packages/gatsby/src/state-machines/develop/actions.ts:176 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}