{"record":{"id":"91275eac6188fd74","repo":"clockworklabs/SpacetimeDB","slug":"call-view-anon-dunder-export-is-a-function-with","errorCode":null,"errorMessage":"{CALL_VIEW_ANON_DUNDER} export is a function with incorrect type: {err}","messagePattern":"(.+?) export is a function with incorrect type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/core/src/host/wasmtime/wasmtime_module.rs","lineNumber":485,"sourceCode":"        export\n            .into_func()\n            .unwrap_or_else(|| panic!(\"{CALL_VIEW_DUNDER} export is not a function\"))\n            .typed(store)\n            .unwrap_or_else(|err| panic!(\"{CALL_VIEW_DUNDER} export is a function with incorrect type: {err}\")),\n    )\n}\n\n/// Look up the `instance`'s export named by [`CALL_VIEW_ANON_DUNDER`].\n///\n/// Similar to [`get_call_procedure`], but for anonymous views.\nfn get_call_view_anon(store: &mut Store<WasmInstanceEnv>, instance: &Instance) -> Option<CallViewAnonType> {\n    let export = instance.get_export(store.as_context_mut(), CALL_VIEW_ANON_DUNDER)?;\n    Some(\n        export\n            .into_func()\n            .unwrap_or_else(|| panic!(\"{CALL_VIEW_ANON_DUNDER} export is not a function\"))\n            .typed(store)\n            .unwrap_or_else(|err| panic!(\"{CALL_VIEW_ANON_DUNDER} export is a function with incorrect type: {err}\")),\n    )\n}\n\n/// Look up the `instance`'s export named by [`CALL_HTTP_HANDLER_DUNDER`].\n///\n/// Similar to [`get_call_procedure`], but for HTTP handlers.\nfn get_call_http_handler(store: &mut Store<WasmInstanceEnv>, instance: &Instance) -> Option<CallHttpHandlerType> {\n    let export = instance.get_export(store.as_context_mut(), CALL_HTTP_HANDLER_DUNDER)?;\n    Some(\n        export\n            .into_func()\n            .unwrap_or_else(|| panic!(\"{CALL_HTTP_HANDLER_DUNDER} export is not a function\"))\n            .typed(store)\n            .unwrap_or_else(|err| panic!(\"{CALL_HTTP_HANDLER_DUNDER} export is a function with incorrect type: {err}\")),\n    )\n}\n\n// `__call_procedure__` takes the same arguments as `__call_reducer__`.","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/core/src/host/wasmtime/wasmtime_module.rs#L467-L503","documentation":"The `__call_view_anon__` export exists and is a function, but its wasm signature does not match `CallViewAnonType`, so `TypedFunc::typed` fails and the host panics. Anonymous views pass a different argument shape than named views, and this build expects a specific one. The usual cause is a module compiled against a different SDK/server ABI revision.","triggerScenarios":"Publishing a module whose anonymous-view entry signature (argument hash / sender parameters) differs from the TypedFunc type this server binds.","commonSituations":"Upgrading the server across a release that changed anonymous view calling conventions while keeping the old module artifact; mixing modules built by different bindgen versions in one deployment.","solutions":["Rebuild the module with the SDK matching the running server and republish.","Verify the export signature with wasm-objdump/wasm2wat against a freshly generated reference module.","If maintaining a fork, align your entry-point signature with the server's CallViewAnonType definition."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"use wasmtime::{Engine, Module, ExternType};\n\nfn anon_view_signature_matches(engine: &Engine, wasm: &[u8], expected_params: usize) -> Result<(), String> {\n    let module = Module::new(engine, wasm).map_err(|e| e.to_string())?;\n    if let Some(exp) = module.get_export(\"__call_view_anon__\") {\n        if let ExternType::Func(f) = exp.ty() {\n            if f.params().len() != expected_params {\n                return Err(format!(\"__call_view_anon__ has {} params, expected {expected_params}\", f.params().len()));\n            }\n        }\n    }\n    Ok(())\n}","typeGuard":"fn is_func_export(ty: &ExternType) -> bool { matches!(ty, ExternType::Func(_)) }","tryCatchPattern":null,"preventionTips":["Publish from a clean build directory after SDK upgrades.","Verify module/server compatibility in a staging environment before production.","Track anonymous-view ABI changes in release notes when upgrading."],"tags":["wasm","wasmtime","abi-mismatch","anonymous-views","spacetimedb"],"backgroundTag":"wasm-abi-mismatch","analyzedSha":"6dee26c6efc2856793e12b148a59742964f5d783","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}