{"record":{"id":"1fc838f2d3277088","repo":"clockworklabs/SpacetimeDB","slug":"unknown-reducerid-reducerid","errorCode":null,"errorMessage":"unknown reducerId ${reducerId}","messagePattern":"unknown reducerId (.+?)","errorType":"exception","errorClass":"RangeError","httpStatus":null,"severity":"critical","filePath":"crates/bindings-typescript/src/server/runtime.ts","lineNumber":577,"sourceCode":"\n    if (reducerId < this.#consumerReducerCount) {\n      fn = this.#schema.reducers[reducerId];\n      dbView = this.#dbView;\n      asViews = this.#consumerAs;\n    } else {\n      let offset = this.#consumerReducerCount;\n      for (let i = 0; i < this.#flatSubmodules.length; i++) {\n        const m = this.#flatSubmodules[i];\n        if (reducerId < offset + m.reducerFns.length) {\n          fn = m.reducerFns[reducerId - offset];\n          dbView = this.#getSubmoduleDbView(i);\n          asViews = this.#getSubmoduleAsViews(i);\n          break;\n        }\n        offset += m.reducerFns.length;\n      }\n      if (fn === undefined) {\n        throw new RangeError(`unknown reducerId ${reducerId}`);\n      }\n    }\n\n    const ctx = this.#reducerCtx;\n    ReducerCtxImpl.reset(\n      ctx,\n      senderIdentity,\n      new Timestamp(timestamp),\n      ConnectionId.nullIfZero(new ConnectionId(connId)),\n      dbView!,\n      asViews!\n    );\n    callUserFunction(fn, ctx, args);\n  }\n\n  __call_view__(\n    id: u32,\n    sender: u256,","sourceCodeStart":559,"sourceCodeEnd":595,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/bindings-typescript/src/server/runtime.ts#L559-L595","documentation":"When the host invokes a reducer, the module runtime maps the numeric reducerId from the wire onto the flattened list of reducer functions across the root module and all submodules. If the id falls outside every submodule's range (>= total reducer count), dispatch throws RangeError('unknown reducerId <n>'): the host and the deployed module disagree about the reducer table.","triggerScenarios":"The dispatching host was built against a different module schema: the module was redeployed with reducers removed or reordered while an in-flight call or stale host state references old ids; submodule sets differing between builds of the same module.","commonSituations":"Redeploying a module with reordered/removed reducers while old bindings or host caches persist; version skew between the spacetimedb host, the hosttools that generated code, and the deployed module; partial or failed deploys.","solutions":["Redeploy the module and reconnect clients so reducer ids are regenerated consistently","Regenerate client bindings against the currently deployed module (spacetime generate)","Treat reducer signatures as append-only between deploys: add new reducers instead of reordering or removing old ones","If it persists, restart the host to clear stale dispatch state and report the module hash plus host version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat reducer signatures as append-only: add new reducers, never reorder or remove, between deploys","Regenerate bindings (spacetime generate) after every module schema change and reconnect clients","Pin host, hosttools, and SDK versions together and verify the deployed module hash after each deploy"],"tags":["dispatch","schema-mismatch","reducer","typescript"],"backgroundTag":"unknown-dispatch-id","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}