waygraph / WAYGRAPH_ERRORS
Variable: WAYGRAPH_ERRORS
constWAYGRAPH_ERRORS:object
Defined in: src/engine/errors.ts:11
Every error the engine throws, in one file, each with a stable code. When something breaks, grep WG_ the-error-you-saw (or open this file and Ctrl-F the code) tells you exactly what threw, why, and where to look - without re-explaining the engine to an AI every time.
Convention: WG_<AREA>_<WHAT>. A code, once shipped, never changes meaning or gets reused for something else - add a new one instead. Every thrown WaygraphError message starts with [CODE], so the code survives being copy-pasted out of a terminal/CI log on its own.
Type Declaration
WG_BRANCH_REGRESSION_NO_BROWSER
readonlyWG_BRANCH_REGRESSION_NO_BROWSER:object
WG_BRANCH_REGRESSION_NO_BROWSER.fix
readonlyfix:"Pass { cloneSession: false } to run the single live path in this context instead."="Pass { cloneSession: false } to run the single live path in this context instead."
WG_BRANCH_REGRESSION_NO_BROWSER.means
readonlymeans:"cloneSession is on (the default) but context.browser() returned null - a persistent context has no Browser to clone a new context from."="cloneSession is on (the default) but context.browser() returned null - a persistent context has no Browser to clone a new context from."
WG_BRANCH_REGRESSION_NO_BROWSER.where
readonlywhere:"engine/flow/branch-regression.ts - runBranchRegression()"="engine/flow/branch-regression.ts - runBranchRegression()"
WG_COMPOSE_EMPTY
readonlyWG_COMPOSE_EMPTY:object
WG_COMPOSE_EMPTY.fix
readonlyfix:"Pass at least one Block."="Pass at least one Block."
WG_COMPOSE_EMPTY.means
readonlymeans:"composeBlock() was called with zero steps."="composeBlock() was called with zero steps."
WG_COMPOSE_EMPTY.where
readonlywhere:"engine/block/compose.ts - composeBlock()"="engine/block/compose.ts - composeBlock()"
WG_EXPECT_CHANGED_PAGE
readonlyWG_EXPECT_CHANGED_PAGE:object
WG_EXPECT_CHANGED_PAGE.fix
readonlyfix:"Make the action a step of its own (a Method Block) before the step whose expectation reads what it left."="Make the action a step of its own (a Method Block) before the step whose expectation reads what it left."
WG_EXPECT_CHANGED_PAGE.means
readonlymeans:"An expectation clicked, typed, navigated or otherwise acted on the page. Expectations only read and judge."="An expectation clicked, typed, navigated or otherwise acted on the page. Expectations only read and judge."
WG_EXPECT_CHANGED_PAGE.where
readonlywhere:"engine/run/read-only.ts - a step's expectations"="engine/run/read-only.ts - a step's expectations"
WG_EXPECT_SET_MEM
readonlyWG_EXPECT_SET_MEM:object
WG_EXPECT_SET_MEM.fix
readonlyfix:"Set the key in a Block's act (or with .set() in the flow), and let the expectation read it."="Set the key in a Block's act (or with .set() in the flow), and let the expectation read it."
WG_EXPECT_SET_MEM.means
readonlymeans:"An expectation set a mem key. Expectations only read; a step that records something sets it in its act."="An expectation set a mem key. Expectations only read; a step that records something sets it in its act."
WG_EXPECT_SET_MEM.where
readonlywhere:"engine/run/expect.ts - a step's expectations"="engine/run/expect.ts - a step's expectations"
WG_FASTFORWARD_EMPTY
readonlyWG_FASTFORWARD_EMPTY:object
WG_FASTFORWARD_EMPTY.fix
readonlyfix:"Add at least one Block between ffStart()/ffEnd() (or the equivalent Map builder call)."="Add at least one Block between ffStart()/ffEnd() (or the equivalent Map builder call)."
WG_FASTFORWARD_EMPTY.means
readonlymeans:"A fast-forward window was closed with zero steps inside it."="A fast-forward window was closed with zero steps inside it."
WG_FASTFORWARD_EMPTY.where
readonlywhere:"engine/block/compose.ts - fastForwardComposeBlock()"="engine/block/compose.ts - fastForwardComposeBlock()"
WG_FLOW_BLOCK_NOT_FOUND
readonlyWG_FLOW_BLOCK_NOT_FOUND:object
WG_FLOW_BLOCK_NOT_FOUND.fix
readonlyfix:"Check the name/index against flow.blocks() - it lists every Block this Flow actually has, tag-prefixed for branches."="Check the name/index against flow.blocks() - it lists every Block this Flow actually has, tag-prefixed for branches."
WG_FLOW_BLOCK_NOT_FOUND.means
readonlymeans:"The Block name/index/reference given doesn't exist in this Flow (or chained Flows)."="The Block name/index/reference given doesn't exist in this Flow (or chained Flows)."
WG_FLOW_BLOCK_NOT_FOUND.where
readonlywhere:"engine/block/block.ts - findBlock() (used by withBlockVerify/modBlockVerify)"="engine/block/block.ts - findBlock() (used by withBlockVerify/modBlockVerify)"
WG_GIVEN_FAILED
readonlyWG_GIVEN_FAILED:object
WG_GIVEN_FAILED.fix
readonlyfix:"Fix the seeding Block (its call, its verify) or the data it needs; the scenario itself was never judged."="Fix the seeding Block (its call, its verify) or the data it needs; the scenario itself was never judged."
WG_GIVEN_FAILED.means
readonlymeans:"A precondition of the flow (`map({ given })`) couldn't be set up, so the flow was not played: the run is blocked, not failed."="A precondition of the flow (`map({ given })`) couldn't be set up, so the flow was not played: the run is blocked, not failed."
WG_GIVEN_FAILED.where
readonlywhere:"engine/flow/flow.ts - Flow.run, runner/play-steps.ts - a flow's `given` Block"="engine/flow/flow.ts - Flow.run, runner/play-steps.ts - a flow's `given` Block"
WG_MAP_BRANCH_NO_PRIOR_STEP
readonlyWG_MAP_BRANCH_NO_PRIOR_STEP:object
WG_MAP_BRANCH_NO_PRIOR_STEP.fix
readonlyfix:"Add a .gotoPage()/.gotoExternal()/.method() before .branch()."="Add a .gotoPage()/.gotoExternal()/.method() before .branch()."
WG_MAP_BRANCH_NO_PRIOR_STEP.means
readonlymeans:".branch() was called before any step existed to branch FROM."=".branch() was called before any step existed to branch FROM."
WG_MAP_BRANCH_NO_PRIOR_STEP.where
readonlywhere:"engine/flow/map-builder.ts - MapBuilder.branch()"="engine/flow/map-builder.ts - MapBuilder.branch()"
WG_MAP_BRANCH_SHARED_SESSION_UNSUPPORTED
readonlyWG_MAP_BRANCH_SHARED_SESSION_UNSUPPORTED:object
WG_MAP_BRANCH_SHARED_SESSION_UNSUPPORTED.fix
readonlyfix:"Call run(context, mem[, options]) instead, keeping the same page across the branch."="Call run(context, mem[, options]) instead, keeping the same page across the branch."
WG_MAP_BRANCH_SHARED_SESSION_UNSUPPORTED.means
readonlymeans:"run(mem, config) was called on a branched Flow - that convenience form always closes its own browser/page before the branch's tag is known, so the branch can never be reached."="run(mem, config) was called on a branched Flow - that convenience form always closes its own browser/page before the branch's tag is known, so the branch can never be reached."
WG_MAP_BRANCH_SHARED_SESSION_UNSUPPORTED.where
readonlywhere:"engine/flow/map-builder.ts - a .branch()-built Flow's run()"="engine/flow/map-builder.ts - a .branch()-built Flow's run()"
WG_MAP_EMPTY
readonlyWG_MAP_EMPTY:object
WG_MAP_EMPTY.fix
readonlyfix:"Add at least one .gotoPage()/.gotoExternal()/.method()."="Add at least one .gotoPage()/.gotoExternal()/.method()."
WG_MAP_EMPTY.means
readonlymeans:"A map() with no steps was used as a flow."="A map() with no steps was used as a flow."
WG_MAP_EMPTY.where
readonlywhere:"engine/flow/map-builder.ts - the flow, when first used"="engine/flow/map-builder.ts - the flow, when first used"
WG_MAP_FF_ALREADY_OPEN
readonlyWG_MAP_FF_ALREADY_OPEN:object
WG_MAP_FF_ALREADY_OPEN.fix
readonlyfix:"Call .ffEnd() before opening another fast-forward window."="Call .ffEnd() before opening another fast-forward window."
WG_MAP_FF_ALREADY_OPEN.means
readonlymeans:".ffStart() was called while a previous .ffStart() window is still open."=".ffStart() was called while a previous .ffStart() window is still open."
WG_MAP_FF_ALREADY_OPEN.where
readonlywhere:"engine/flow/map-builder.ts - MapBuilder.ffStart()"="engine/flow/map-builder.ts - MapBuilder.ffStart()"
WG_MAP_FF_EMPTY
readonlyWG_MAP_FF_EMPTY:object
WG_MAP_FF_EMPTY.fix
readonlyfix:"Add at least one .gotoPage()/.method() inside the .ffStart()/.ffEnd() window."="Add at least one .gotoPage()/.method() inside the .ffStart()/.ffEnd() window."
WG_MAP_FF_EMPTY.means
readonlymeans:".ffEnd() closed a window with zero steps inside it."=".ffEnd() closed a window with zero steps inside it."
WG_MAP_FF_EMPTY.where
readonlywhere:"engine/flow/map-builder.ts - MapBuilder.ffEnd()"="engine/flow/map-builder.ts - MapBuilder.ffEnd()"
WG_MAP_FF_NOT_CLOSED
readonlyWG_MAP_FF_NOT_CLOSED:object
WG_MAP_FF_NOT_CLOSED.fix
readonlyfix:"Close it with .ffEnd() after its last step."="Close it with .ffEnd() after its last step."
WG_MAP_FF_NOT_CLOSED.means
readonlymeans:"The flow was used (run, listed, nested, branched) while a .ffStart() window was still open."="The flow was used (run, listed, nested, branched) while a .ffStart() window was still open."
WG_MAP_FF_NOT_CLOSED.where
readonlywhere:"engine/flow/map-builder.ts - the flow, when first used"="engine/flow/map-builder.ts - the flow, when first used"
WG_MAP_FF_NOT_OPEN
readonlyWG_MAP_FF_NOT_OPEN:object
WG_MAP_FF_NOT_OPEN.fix
readonlyfix:"Remove the stray .ffEnd(), or add the .ffStart() it's meant to close."="Remove the stray .ffEnd(), or add the .ffStart() it's meant to close."
WG_MAP_FF_NOT_OPEN.means
readonlymeans:".ffEnd() was called with no matching .ffStart()."=".ffEnd() was called with no matching .ffStart()."
WG_MAP_FF_NOT_OPEN.where
readonlywhere:"engine/flow/map-builder.ts - MapBuilder.ffEnd()"="engine/flow/map-builder.ts - MapBuilder.ffEnd()"
WG_MAP_LANDS
readonlyWG_MAP_LANDS:object
WG_MAP_LANDS.fix
readonlyfix:"If the other outcome is a real case, write a flow (or a .branch()) for it; otherwise fix the step before it (wrong data) or the Block's resolve."="If the other outcome is a real case, write a flow (or a .branch()) for it; otherwise fix the step before it (wrong data) or the Block's resolve."
WG_MAP_LANDS.means
readonlymeans:"A step said which of its Block's outcomes the flow continues from (`lands`), and the Block resolved to another one - or `lands` names a Checkpoint the Block never resolves to."="A step said which of its Block's outcomes the flow continues from (`lands`), and the Block resolved to another one - or `lands` names a Checkpoint the Block never resolves to."
WG_MAP_LANDS.where
readonlywhere:"engine/flow/map-builder.ts - .method/.gotoPage/.gotoExternal(Block, { lands })"="engine/flow/map-builder.ts - .method/.gotoPage/.gotoExternal(Block, { lands })"
WG_MAP_NO_INPUT
readonlyWG_MAP_NO_INPUT:object
WG_MAP_NO_INPUT.fix
readonlyfix:"Declare the sub-flow's input with `map({ input: SomeKey })`, or drop `input` from the `.flow()` call."="Declare the sub-flow's input with `map({ input: SomeKey })`, or drop `input` from the `.flow()` call."
WG_MAP_NO_INPUT.means
readonlymeans:"`.flow()` was given an input for a sub-flow that takes none (it has no `map({ input })`)."="`.flow()` was given an input for a sub-flow that takes none (it has no `map({ input })`)."
WG_MAP_NO_INPUT.where
readonlywhere:"engine/flow/map-builder.ts - .flow(sub, { input })"="engine/flow/map-builder.ts - .flow(sub, { input })"
WG_MAP_STEPS_END
readonlyWG_MAP_STEPS_END:object
WG_MAP_STEPS_END.fix
readonlyfix:"Play it in a flow with .steps(part); a .branch() goes in the flow, after it."="Play it in a flow with .steps(part); a .branch() goes in the flow, after it."
WG_MAP_STEPS_END.means
readonlymeans:"A part made with steps() was run, nested or branched as a flow: a part is steps a flow plays, not a flow."="A part made with steps() was run, nested or branched as a flow: a part is steps a flow plays, not a flow."
WG_MAP_STEPS_END.where
readonlywhere:"engine/flow/map-builder.ts - steps()"="engine/flow/map-builder.ts - steps()"
WG_MAP_WRONG_KIND
readonlyWG_MAP_WRONG_KIND:object
WG_MAP_WRONG_KIND.fix
readonlyfix:"Use the factory the error names, or move this Block to the matching .gotoPage()/.method() call (an Expect Block goes in expect: [...])."="Use the factory the error names, or move this Block to the matching .gotoPage()/.method() call (an Expect Block goes in expect: [...])."
WG_MAP_WRONG_KIND.means
readonlymeans:"A Block passed to a MapBuilder step method doesn't carry the __waygraphKind a real defineNavBlock/definePageBlock/defineMethodBlock stamps - either the wrong factory was used, or the object was hand-rolled instead of going through one."="A Block passed to a MapBuilder step method doesn't carry the __waygraphKind a real defineNavBlock/definePageBlock/defineMethodBlock stamps - either the wrong factory was used, or the object was hand-rolled instead of going through one."
WG_MAP_WRONG_KIND.where
readonlywhere:"engine/flow/map-builder.ts - MapBuilder.gotoPage/gotoExternal/method()"="engine/flow/map-builder.ts - MapBuilder.gotoPage/gotoExternal/method()"
WG_MAP_WRONG_ORIGIN
readonlyWG_MAP_WRONG_ORIGIN:object
WG_MAP_WRONG_ORIGIN.fix
readonlyfix:"Use .gotoExternal() for a genuinely different origin, .gotoPage() for the app's own homeOrigin, or fix the Block's url."="Use .gotoExternal() for a genuinely different origin, .gotoPage() for the app's own homeOrigin, or fix the Block's url."
WG_MAP_WRONG_ORIGIN.means
readonlymeans:"A Block's static `url` origin doesn't match what .gotoPage() (same-origin) or .gotoExternal() (cross-origin) expects, given this map()'s homeOrigin."="A Block's static `url` origin doesn't match what .gotoPage() (same-origin) or .gotoExternal() (cross-origin) expects, given this map()'s homeOrigin."
WG_MAP_WRONG_ORIGIN.where
readonlywhere:"engine/flow/map-builder.ts - MapBuilder.gotoPage/gotoExternal()"="engine/flow/map-builder.ts - MapBuilder.gotoPage/gotoExternal()"
WG_MAP_WRONG_SALT
readonlyWG_MAP_WRONG_SALT:object
WG_MAP_WRONG_SALT.fix
readonlyfix:"Build it with defineMethodBlock; an Expect Block goes in a step's expect: [...], not in a step."="Build it with defineMethodBlock; an Expect Block goes in a step's expect: [...], not in a step."
WG_MAP_WRONG_SALT.means
readonlymeans:"A Block passed to .method() isn't a real Method Block (missing __waygraphSalt)."="A Block passed to .method() isn't a real Method Block (missing __waygraphSalt)."
WG_MAP_WRONG_SALT.where
readonlywhere:"engine/flow/map-builder.ts - MapBuilder.method()"="engine/flow/map-builder.ts - MapBuilder.method()"
WG_MEM_READ_BEFORE_SET
readonlyWG_MEM_READ_BEFORE_SET:object
WG_MEM_READ_BEFORE_SET.fix
readonlyfix:"Set it first, or use mem.has(key) to check before an optional read."="Set it first, or use mem.has(key) to check before an optional read."
WG_MEM_READ_BEFORE_SET.means
readonlymeans:"mem.get(key) was called for a key that was never mem.set() on this MemPage."="mem.get(key) was called for a key that was never mem.set() on this MemPage."
WG_MEM_READ_BEFORE_SET.where
readonlywhere:"engine/mem/mem.ts - MemPage.get()"="engine/mem/mem.ts - MemPage.get()"
WG_MODVERIFY_FUNCTION_FORM
readonlyWG_MODVERIFY_FUNCTION_FORM:object
WG_MODVERIFY_FUNCTION_FORM.fix
readonlyfix:"Use withVerify() to replace the whole verify instead."="Use withVerify() to replace the whole verify instead."
WG_MODVERIFY_FUNCTION_FORM.means
readonlymeans:"modVerify() was called on a Block whose verify is a function (tag-driven), which has no fixed list to address an item into."="modVerify() was called on a Block whose verify is a function (tag-driven), which has no fixed list to address an item into."
WG_MODVERIFY_FUNCTION_FORM.where
readonlywhere:"engine/block/block.ts - modVerify()"="engine/block/block.ts - modVerify()"
WG_MODVERIFY_NOT_FOUND
readonlyWG_MODVERIFY_NOT_FOUND:object
WG_MODVERIFY_NOT_FOUND.fix
readonlyfix:"Check the Block's actual verify list for the right name/index."="Check the Block's actual verify list for the right name/index."
WG_MODVERIFY_NOT_FOUND.means
readonlymeans:"The Trait name/index given doesn't exist in this Block's verify list."="The Trait name/index given doesn't exist in this Block's verify list."
WG_MODVERIFY_NOT_FOUND.where
readonlywhere:"engine/block/block.ts - modVerify()"="engine/block/block.ts - modVerify()"
WG_PANES
readonlyWG_PANES:object
WG_PANES.fix
readonlyfix:"Name panes the flow declares; give `as` only to a pane with its own context; share a context with `with` where the browser has only one (a persistent context, as with extensions)."="Name panes the flow declares; give `as` only to a pane with its own context; share a context with `with` where the browser has only one (a persistent context, as with extensions)."
WG_PANES.means
readonlymeans:"A flow's panes don't fit: a pane `with` one that isn't there (or that shares another's), an `as` on a pane that shares a context, a step in a pane the flow doesn't declare, or a pane that needs a context of its own in a browser that can't make one."="A flow's panes don't fit: a pane `with` one that isn't there (or that shares another's), an `as` on a pane that shares a context, a step in a pane the flow doesn't declare, or a pane that needs a context of its own in a browser that can't make one."
WG_PANES.where
readonlywhere:"engine/flow/panes.ts - map({ panes }), .in(pane)"="engine/flow/panes.ts - map({ panes }), .in(pane)"
WG_PREFLIGHT_MISSING_KEY
readonlyWG_PREFLIGHT_MISSING_KEY:object
WG_PREFLIGHT_MISSING_KEY.fix
readonlyfix:"Pass --data / a mem.set() call for that key, or registerMemStub + --mem-stub for a fake value."="Pass --data / a mem.set() call for that key, or registerMemStub + --mem-stub for a fake value."
WG_PREFLIGHT_MISSING_KEY.means
readonlymeans:"A Flow/chain needs a MemKey that mem.set() never received before run() started."="A Flow/chain needs a MemKey that mem.set() never received before run() started."
WG_PREFLIGHT_MISSING_KEY.where
readonlywhere:"engine/run/run.ts - preflight()"="engine/run/run.ts - preflight()"
WG_READ_DUPLICATE
readonlyWG_READ_DUPLICATE:object
WG_READ_DUPLICATE.fix
readonlyfix:"Read each key in one Read Block per Checkpoint (an every-page Read Block counts for every Checkpoint)."="Read each key in one Read Block per Checkpoint (an every-page Read Block counts for every Checkpoint)."
WG_READ_DUPLICATE.means
readonlymeans:"Two Read Blocks for the same page both read one key, so it has two answers."="Two Read Blocks for the same page both read one key, so it has two answers."
WG_READ_DUPLICATE.where
readonlywhere:"engine/read/read-block.ts - readCheckpoint()"="engine/read/read-block.ts - readCheckpoint()"
WG_READ_MISSING
readonlyWG_READ_MISSING:object
WG_READ_MISSING.fix
readonlyfix:"Check read.has(key) first, or read.missing / read.notes for why; add the field to the page's Read Block."="Check read.has(key) first, or read.missing / read.notes for why; add the field to the page's Read Block."
WG_READ_MISSING.means
readonlymeans:"read.get(key) asked for a value the page did not show, or that no Read Block for this page reads."="read.get(key) asked for a value the page did not show, or that no Read Block for this page reads."
WG_READ_MISSING.where
readonlywhere:"engine/read/read-page.ts - ReadPage.get()"="engine/read/read-page.ts - ReadPage.get()"
WG_RUNGRAPH_MAX_STEPS
readonlyWG_RUNGRAPH_MAX_STEPS:object
WG_RUNGRAPH_MAX_STEPS.fix
readonlyfix:"Check the Block(s) involved in the loop; raise maxSteps only if the loop is genuinely intended."="Check the Block(s) involved in the loop; raise maxSteps only if the loop is genuinely intended."
WG_RUNGRAPH_MAX_STEPS.means
readonlymeans:"A chain took more steps than maxSteps without reaching a Block with no .next() - almost always an unintended self-loop in branch()/next routing."="A chain took more steps than maxSteps without reaching a Block with no .next() - almost always an unintended self-loop in branch()/next routing."
WG_RUNGRAPH_MAX_STEPS.where
readonlywhere:"engine/run/run.ts - runGraph()"="engine/run/run.ts - runGraph()"
WG_RUNGRAPH_NOT_TERMINAL
readonlyWG_RUNGRAPH_NOT_TERMINAL:object
WG_RUNGRAPH_NOT_TERMINAL.fix
readonlyfix:"Add that Checkpoint to `terminals`, or fix the Block's resolve() - it landed somewhere the caller didn't expect."="Add that Checkpoint to `terminals`, or fix the Block's resolve() - it landed somewhere the caller didn't expect."
WG_RUNGRAPH_NOT_TERMINAL.means
readonlymeans:"A Block with no .next() resolved to a Checkpoint that wasn't in the caller's declared `terminals` set."="A Block with no .next() resolved to a Checkpoint that wasn't in the caller's declared `terminals` set."
WG_RUNGRAPH_NOT_TERMINAL.where
readonlywhere:"engine/run/run.ts - runGraph()"="engine/run/run.ts - runGraph()"
WG_STATE_NEEDED
readonlyWG_STATE_NEEDED:object
WG_STATE_NEEDED.fix
readonlyfix:"Run the flow as an account that has the state (`map({ as })`), or put a step before it that sets it (`sets`)."="Run the flow as an account that has the state (`map({ as })`), or put a step before it that sets it (`sets`)."
WG_STATE_NEEDED.means
readonlymeans:"A step landed on a page that `needs` a state (signed in) the run is not in."="A step landed on a page that `needs` a state (signed in) the run is not in."
WG_STATE_NEEDED.where
readonlywhere:"engine/mem/state.ts - applyStates()"="engine/mem/state.ts - applyStates()"