{"record":{"id":"f2ef083cb30ef44a","repo":"wasmerio/wasmer","slug":"only-numeric-types-are-supported-in-function-signa","errorCode":null,"errorMessage":"only numeric types are supported in function signatures","messagePattern":"only numeric types are supported in function signatures","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/compiler/src/translator/sections.rs","lineNumber":93,"sourceCode":"/// Parses the Type section of the wasm module.\npub fn parse_type_section(\n    types: TypeSectionReader,\n    module_translation_state: &mut ModuleTranslationState,\n    environ: &mut ModuleEnvironment,\n) -> WasmResult<()> {\n    let count = types.count();\n    environ.reserve_signatures(count)?;\n\n    for res in types.into_iter_err_on_gc_types() {\n        let functype = res.map_err(from_binaryreadererror_wasmerror)?;\n\n        let params = functype.params();\n        let returns = functype.results();\n        let sig_params: Box<[Type]> = params\n            .iter()\n            .map(|ty| {\n                wptype_to_type(*ty)\n                    .expect(\"only numeric types are supported in function signatures\")\n            })\n            .collect();\n        let sig_returns: Box<[Type]> = returns\n            .iter()\n            .map(|ty| {\n                wptype_to_type(*ty)\n                    .expect(\"only numeric types are supported in function signatures\")\n            })\n            .collect();\n        let sig = FunctionType::new(sig_params, sig_returns);\n        environ.declare_signature(sig)?;\n        module_translation_state\n            .wasm_types\n            .push((params.to_vec().into(), returns.to_vec().into()));\n    }\n\n    Ok(())\n}","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler/src/translator/sections.rs#L75-L111","documentation":"When translating a Wasm module's type section, each value type is converted from the wasm-parser type to the compiler Type via wptype_to_type. This translator only supports numeric types (i32/i64/f32/f64 and refs per version); if a parameter type in a function signature cannot be represented (e.g. an unsupported SIMD or reference type), the translator panics instead of returning an error.","triggerScenarios":"Translating (compiling) a module whose type section declares function params with a type wptype_to_type cannot map — e.g. v128 SIMD types or newer reference types when the compiler feature doesn't enable them.","commonSituations":"Compiling Wasm modules that use SIMD or reference types with a wasmer build compiled without simd/reference-types features; older wasmer versions encountering modern modules.","solutions":["Rebuild wasmer with simd and reference-types features enabled","Upgrade wasmer to a version supporting the value types used by the module","Recompile the Wasm module to avoid unsupported types (e.g. no SIMD: build with `-m no-simd` toolchain flags)","Validate the module with wasm-tools/wasmparser to see which types are unsupported"],"exampleFix":"// build with features\n// before\nwasmer = { version = \"...\", default-features = true }\n// after\nwasmer = { version = \"...\", features = [\"simd\", \"reference-types\"] }","handlingStrategy":"validation","validationCode":"// Validate module types before compiling\nuse wasmparser::{Validator, WasmFeatures};\nValidator::new_with_features(WasmFeatures::default() | WasmFeatures::SIMD)\n    .validate_all(&wasm_bytes)\n    .map_err(|e| anyhow!(\"module uses unsupported types: {e}\"))?;","typeGuard":"fn has_unsupported_types(bytes: &[u8]) -> bool {\n    wasmparser::Validator::new().validate_all(bytes).is_err()\n}","tryCatchPattern":"std::panic::catch_unwind(|| compile_module(&engine, &wasm_bytes))\n    .map_err(|_| anyhow::anyhow!(\"module uses value types unsupported by this compiler build\"))?","preventionTips":["Build wasmer with simd and reference-types features if you run modern modules","Pre-validate all Wasm binaries with wasm-tools validate before compiling","Pin toolchain flags (no-simd) when producing modules for MVP-only runtimes","Check module feature usage with wasm-tools objdump before deployment"],"tags":["panic","compiler","wasm","simd","type-section"],"backgroundTag":"unsupported-wasm-value-type","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}