gatsbyjs/gatsby · critical
Missing required params
Error message
Missing required params
What it means
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.
Source
Thrown at packages/gatsby/src/services/start-webpack-server.ts:35
import { IBuildContext } from "./"
import {
markWebpackStatusAsPending,
markWebpackStatusAsDone,
} from "../utils/webpack-status"
import { emitter } from "../redux"
export async function startWebpackServer({
program,
app,
workerPool,
store,
}: Partial<IBuildContext>): Promise<{
compiler: Compiler
websocketManager: WebsocketManager
webpackWatching: WebpackWatching
}> {
if (!program || !app || !store) {
report.panic(`Missing required params`)
}
let { compiler, webpackActivity, websocketManager, webpackWatching } =
await startServer(program, app, workerPool)
compiler.hooks.invalid.tap(`log compiling`, function () {
if (!webpackActivity) {
// mark webpack as pending if we are not in the middle of compilation already
// when input is invalidated during compilation, webpack will automatically
// run another compilation round before triggering `done` event
report.pendingActivity({ id: `webpack-develop` })
markWebpackStatusAsPending()
}
})
compiler.hooks.watchRun.tapAsync(`log compiling`, function (_, done) {
if (!webpackActivity) {
// there can be multiple `watchRun` events before receiving single `done` event
// webpack will not emit assets or `done` event until all pending invalidatedView on GitHub (pinned to 8b06340921)
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.
Defensive patterns
Strategy: validation
Validate before calling
// Validate required params before calling startWebpackServer
function validateDevServerContext(ctx) {
if (!ctx.program) throw new Error('Missing program in dev server context')
if (!ctx.app) throw new Error('Missing Express app in dev server context')
if (!ctx.store) throw new Error('Missing Redux store in dev server context')
} Type guard
function isValidDevServerContext(ctx) {
return (
typeof ctx === 'object' &&
ctx !== null &&
typeof ctx.program === 'object' &&
typeof ctx.app === 'object' &&
typeof ctx.store === 'object'
)
} Prevention
- This is an internal invariant -- restart gatsby develop if hit.
- Keep Gatsby updated to the latest version.
- Report bugs with a minimal reproduction.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Missing compiler
- something changed in webpack but I don't know what
- Encountered unknown module type: ${module.type}. Please open
- Could not find Redux store
- page not found
AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13).
Data as JSON: /api/errors/3f00150f97ad19bc.
Report an issue: GitHub.