{"record":{"id":"93c30dff03e0e3c0","repo":"clockworklabs/SpacetimeDB","slug":"unable-to-serialize-typespace","errorCode":null,"errorMessage":"unable to serialize typespace","messagePattern":"unable to serialize typespace","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bindings/src/rt.rs","lineNumber":988,"sourceCode":"/// as it is being changed by the schema proposal.\n///\n/// The `ModuleDef` is used to define tables, constraints, indexes, reducers, etc.\n/// This affords the module the opportunity\n/// to define and, to a limited extent, alter the schema at initialization time,\n/// including when modules are updated (re-publishing).\n/// After initialization, the module cannot alter the schema.\n#[unsafe(no_mangle)]\nextern \"C\" fn __describe_module__(description: BytesSink) {\n    // Collect the `module`.\n    let mut module = ModuleBuilder::default();\n    for describer in &mut *DESCRIBERS.lock().unwrap() {\n        describer(&mut module)\n    }\n\n    // Serialize the module to bsatn.\n    let module_def = module.inner.finish();\n    let module_def = RawModuleDef::V10(module_def);\n    let bytes = bsatn::to_vec(&module_def).expect(\"unable to serialize typespace\");\n\n    // Write the sets of reducers, procedures and views.\n    REDUCERS.set(module.reducers).ok().unwrap();\n    PROCEDURES.set(module.procedures).ok().unwrap();\n    #[cfg(feature = \"unstable\")]\n    HTTP_HANDLERS.set(module.http_handlers).ok().unwrap();\n    VIEWS.set(module.views).ok().unwrap();\n    ANONYMOUS_VIEWS.set(module.views_anon).ok().unwrap();\n\n    // Write the bsatn data into the sink.\n    write_to_sink(description, &bytes);\n}\n\n// TODO(1.0): update `__call_reducer__` docs + for `BytesSink`.\n\n/// Called by the host to execute a reducer\n/// when the `sender` calls the reducer identified by `id` at `timestamp` with `args`.\n///","sourceCodeStart":970,"sourceCodeEnd":1006,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/bindings/src/rt.rs#L970-L1006","documentation":"Error \"unable to serialize typespace\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/bindings/src/rt.rs:988 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}