{"record":{"id":"1c0f510ee02f6446","repo":"wasmerio/wasmer","slug":"unsupported-backend-kind-v","errorCode":null,"errorMessage":"Unsupported backend kind {v:?}","messagePattern":"Unsupported backend kind (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/c-api/src/wasm_c_api/engine/mod.rs","lineNumber":47,"sourceCode":"\n    /// The V8 backend.\n    V8,\n}\n\nimpl From<BackendKind> for wasmer_backend_t {\n    fn from(value: BackendKind) -> Self {\n        match value {\n            #[cfg(feature = \"cranelift\")]\n            BackendKind::Cranelift => Self::CRANELIFT,\n            #[cfg(feature = \"llvm\")]\n            BackendKind::LLVM => Self::LLVM,\n            #[cfg(feature = \"singlepass\")]\n            BackendKind::Singlepass => Self::SINGLEPASS,\n            #[cfg(feature = \"sys\")]\n            BackendKind::Headless => Self::HEADLESS,\n            #[cfg(feature = \"v8\")]\n            BackendKind::V8 => Self::V8,\n            v => panic!(\"Unsupported backend kind {v:?}\"),\n        }\n    }\n}\n\nimpl Default for wasmer_backend_t {\n    fn default() -> Self {\n        // Let the `wasmer_api` crate decide which is the default engine, given the enabled\n        // features.\n        wasmer_api::BackendKind::default().into()\n    }\n}\n\n/// An engine is used by the store to drive the compilation and the\n/// execution of a WebAssembly module.\n///\n/// cbindgen:ignore\n#[repr(C)]\n// We can let the API decide which engine is default with the given set of","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/c-api/src/wasm_c_api/engine/mod.rs#L29-L65","documentation":"The From<BackendKind> impl for wasmer_backend_t maps Wasmer backend enum values to C API constants. Backend variants that are not covered by enabled compile-time features fall into the catch-all arm and panic with \"Unsupported backend kind\". The panic means the backend exists in the enum but was not compiled into this Wasmer build.","triggerScenarios":"Creating a wasmer_backend_t from a BackendKind (e.g. V8, WASMI, Singlepass) whose corresponding cargo feature (v8, wasmi, singlepass, sys) was not enabled in the build; the match exhaustively handled only feature-gated variants and hit `v => panic!`.","commonSituations":"Using a prebuilt Wasmer binary/library that lacks the backend your code requests; enabling a backend at runtime through config while the library was compiled without it; version upgrades adding new BackendKind variants that older feature sets don't cover.","solutions":["Rebuild/obtain Wasmer with the needed feature enabled (e.g. cargo build --features v8 / singlepass / sys).","Before selecting a backend, check which backends the installed build supports (runtime introspection or documented feature set).","Add a fallback in your host code to a guaranteed-enabled backend when the preferred one is unavailable.","Verify you are not passing a headless/V8 kind where sys-family backends are required by the API you call."],"exampleFix":"// before (Cargo.toml)\n[dependencies]\nwasmer = { version = \"6\", default-features = true } // no v8 feature\n// after\n[dependencies]\nwasmer = { version = \"6\", features = [\"v8\"] }","handlingStrategy":"fallback","validationCode":"// Check build capabilities before requesting a backend:\n// maintain a list of enabled backends from your build and verify:\nfn backend_available(kind: BackendKind, enabled: &[BackendKind]) -> bool {\n    enabled.contains(&kind)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Track which cargo features your Wasmer build was compiled with.","Fall back to a default backend when the requested one is not compiled in.","Document backend requirements next to deployment configs."],"tags":["rust","panic","c-api","feature-gate","backend"],"backgroundTag":"feature-not-enabled","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}