{"record":{"id":"5e4c47c93b589383","repo":"linera-io/linera-protocol","slug":"a-wasm-runtime-is-required-to-load-user-applicatio","errorCode":null,"errorMessage":"A Wasm runtime is required to load user applications. Please enable the `wasmer` or the `wasmtime` feature flags when compiling `linera-storage`.","messagePattern":"A Wasm runtime is required to load user applications\\. Please enable the `wasmer` or the `wasmtime` feature flags when compiling `linera-storage`\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-storage/src/lib.rs","lineNumber":333,"sourceCode":"        let contract_bytecode = self\n            .thread_pool()\n            .run_send((), move |()| async move {\n                compressed_contract_bytecode.decompress()\n            })\n            .await\n            .await??;\n        match application_description.module_id.vm_runtime {\n            VmRuntime::Wasm => {\n                cfg_if::cfg_if! {\n                    if #[cfg(with_wasm_runtime)] {\n                        let Some(wasm_runtime) = self.wasm_runtime() else {\n                            panic!(\"A Wasm runtime is required to load user applications.\");\n                        };\n                        Ok(WasmContractModule::new(contract_bytecode, wasm_runtime)\n                           .await?\n                           .into())\n                    } else {\n                        panic!(\n                            \"A Wasm runtime is required to load user applications. \\\n                             Please enable the `wasmer` or the `wasmtime` feature flags \\\n                             when compiling `linera-storage`.\"\n                        );\n                    }\n                }\n            }\n            VmRuntime::Evm => {\n                cfg_if::cfg_if! {\n                    if #[cfg(with_revm)] {\n                        let evm_runtime = EvmRuntime::Revm;\n                        Ok(EvmContractModule::new(contract_bytecode, evm_runtime)?\n                           .into())\n                    } else {\n                        panic!(\n                            \"An Evm runtime is required to load user applications. \\\n                             Please enable the `revm` feature flag \\\n                             when compiling `linera-storage`.\"","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-storage/src/lib.rs#L315-L351","documentation":"linera-storage's load_contract dispatches on the application runtime kind. For Wasm modules it needs a Wasm engine, selected via the wasmer or wasmtime cargo features on linera-storage. If the bytecode is Wasm and neither feature is compiled in, it panics with instructions to enable one of them. This is a build-configuration error surfacing at first Wasm app load, i.e. in get_user_contract during block execution.","triggerScenarios":"Calling get_user_contract/load_contract for an application whose bytecode is a Wasm module while the linera-storage crate was built without its wasmer/wasmtime features — e.g. depending on linera-storage with default-features = false, or a downstream binary enabling only with_revm.","commonSituations":"Custom node/indexer/service binaries assembled from Linera crates with a minimal feature set; CI builds that trim features for speed and then run integration tests deploying example Wasm apps; embedding linera-storage into another project's dependency tree where features get unified away.","solutions":["Enable the wasmtime feature (or wasmer) on the linera-storage dependency in your Cargo.toml","Use the standard linera-service build (make build / cargo build -p linera-service), which enables a Wasm runtime by default","If you only deploy EVM applications, keep Wasm apps out of the workload and enable with_revm instead (see the sibling EVM panic)"],"exampleFix":"# before (Cargo.toml)\nlinera-storage = { path = \"../linera-storage\", default-features = false }\n\n# after\nlinera-storage = { path = \"../linera-storage\", default-features = false, features = [\"wasmtime\", \"wasmer\"] }","handlingStrategy":"validation","validationCode":"// Compile-time guard in the binary that loads applications:\nconst _: () = {\n    #[cfg(not(any(feature = \"wasmer\", feature = \"wasmtime\")))]\n    compile_error!(\"enable the wasmer or wasmtime feature on linera-storage to load Wasm contracts\");\n};","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert required runtime features at compile time instead of discovering the panic in production","Mirror the linera-service feature set in downstream builds","Run a deploy-and-execute smoke test in CI for every runtime your deployment must support"],"tags":["storage","wasm","wasmtime","wasmer","feature-flags","smart-contract"],"backgroundTag":"missing-compile-feature","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}