{"record":{"id":"252bae3f80e17aa3","repo":"gatsbyjs/gatsby","slug":"event-data","errorCode":null,"errorMessage":"${event.data}","messagePattern":"\\$\\{event\\.data\\}","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/gatsby/src/state-machines/develop/actions.ts","lineNumber":169,"sourceCode":"})\n\nexport const finishParentSpan = ({ parentSpan }: IBuildContext): void =>\n  parentSpan?.finish()\n\nexport const saveDbState = (): Promise<void> => saveState()\n\nexport 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) {","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/state-machines/develop/actions.ts#L151-L187","documentation":"This is the panic action of the develop state machine (XState). When the state machine transitions to an error state, it dispatches this action, which passes event.data (the error payload from the triggering event) to reporter.panic. The actual message depends entirely on what error event was sent.","triggerScenarios":"Any error event sent to the develop state machine that transitions to the panic state -- e.g. a webpack compilation failure, a schema rebuild error, or any unhandled error inside a state machine action/service. The event.data field carries the specific Error or message.","commonSituations":"A webpack error during develop hot reload that the state machine surfaces as a panic. A source plugin error during a query run cycle. A custom resolver or createResolvers hook throwing. The specific message in event.data identifies the root cause.","solutions":["Read the full event.data in the output -- it contains the actual root-cause error message and stack.","Address the underlying issue identified by the inner error (webpack error, plugin error, resolver error).","Run `gatsby clean` and restart `gatsby develop`.","If the inner error is from a plugin, update or check that plugin's configuration."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// The state machine panic propagates event.data.\n// Guard against errors reaching the panic state by catching in your own actions/services.\nexports.onCreatePage = async ({ page, actions }) => {\n  try {\n    // your logic\n  } catch (err) {\n    // handle gracefully instead of letting it propagate to state machine panic\n    reporter.warn('Page creation issue: ' + err.message)\n  }\n}","preventionTips":["Catch errors in your own gatsby-node.js and plugin code so they don't reach the state machine panic.","Read event.data in the panic output to find the root cause.","Keep plugins updated."],"tags":["state-machine","develop","error-propagation","xstate"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}