{"record":{"id":"3f00150f97ad19bc","repo":"gatsbyjs/gatsby","slug":"missing-required-params","errorCode":null,"errorMessage":"Missing required params","messagePattern":"Missing required params","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/gatsby/src/services/start-webpack-server.ts","lineNumber":35,"sourceCode":"import { IBuildContext } from \"./\"\nimport {\n  markWebpackStatusAsPending,\n  markWebpackStatusAsDone,\n} from \"../utils/webpack-status\"\nimport { emitter } from \"../redux\"\n\nexport async function startWebpackServer({\n  program,\n  app,\n  workerPool,\n  store,\n}: Partial<IBuildContext>): Promise<{\n  compiler: Compiler\n  websocketManager: WebsocketManager\n  webpackWatching: WebpackWatching\n}> {\n  if (!program || !app || !store) {\n    report.panic(`Missing required params`)\n  }\n  let { compiler, webpackActivity, websocketManager, webpackWatching } =\n    await startServer(program, app, workerPool)\n\n  compiler.hooks.invalid.tap(`log compiling`, function () {\n    if (!webpackActivity) {\n      // mark webpack as pending if we are not in the middle of compilation already\n      // when input is invalidated during compilation, webpack will automatically\n      // run another compilation round before triggering `done` event\n      report.pendingActivity({ id: `webpack-develop` })\n      markWebpackStatusAsPending()\n    }\n  })\n\n  compiler.hooks.watchRun.tapAsync(`log compiling`, function (_, done) {\n    if (!webpackActivity) {\n      // there can be multiple `watchRun` events before receiving single `done` event\n      // webpack will not emit assets or `done` event until all pending invalidated","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/services/start-webpack-server.ts#L17-L53","documentation":"The startWebpackServer function requires three params from the build context: program, app (the Express app), and store (the Redux store). If any is missing, the dev server cannot be started. The guard panics immediately with a generic message.","triggerScenarios":"Calling startWebpackServer when the IBuildContext does not have program, app, or store populated. This is an internal invariant -- the develop bootstrap should have created all three before reaching this step.","commonSituations":"Internal state machine regression or ordering issue. Custom programmatic usage of Gatsby internals that doesn't set up the context properly. A crash in an earlier bootstrap step that left the context incomplete.","solutions":["Run `gatsby clean` and restart `gatsby develop`.","Update to the latest Gatsby version -- this is an internal invariant violation.","If using Gatsby programmatically, ensure you pass a fully-constructed context with program, app (Express), and store.","File a bug report if it reproduces on a clean install."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate required params before calling startWebpackServer\nfunction validateDevServerContext(ctx) {\n  if (!ctx.program) throw new Error('Missing program in dev server context')\n  if (!ctx.app) throw new Error('Missing Express app in dev server context')\n  if (!ctx.store) throw new Error('Missing Redux store in dev server context')\n}","typeGuard":"function isValidDevServerContext(ctx) {\n  return (\n    typeof ctx === 'object' &&\n    ctx !== null &&\n    typeof ctx.program === 'object' &&\n    typeof ctx.app === 'object' &&\n    typeof ctx.store === 'object'\n  )\n}","tryCatchPattern":null,"preventionTips":["This is an internal invariant -- restart gatsby develop if hit.","Keep Gatsby updated to the latest version.","Report bugs with a minimal reproduction."],"tags":["webpack","develop","internal","initialization","invariant"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}