{"record":{"id":"f1225227b59df4b7","repo":"zeroclaw-labs/zeroclaw","slug":"wasm-runtime-is-not-available-in-this-build-rebui","errorCode":null,"errorMessage":"WASM runtime is not available in this build. Rebuild with `cargo build --features runtime-wasm` to enable WASM sandbox support. Module requested: {module_name}","messagePattern":"WASM runtime is not available in this build\\. Rebuild with `cargo build --features runtime-wasm` to enable WASM sandbox support\\. Module requested: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/platform/wasm.rs","lineNumber":231,"sourceCode":"        let fuel_consumed = fuel_before.saturating_sub(fuel_after);\n\n        Ok(WasmExecutionResult {\n            stdout: String::new(),  // No WASI stdout yet — pure computation\n            stderr: String::new(),\n            exit_code,\n            fuel_consumed,\n        })\n    }\n\n    /// Stub for when the `runtime-wasm` feature is not enabled.\n    #[cfg(not(feature = \"runtime-wasm\"))]\n    pub fn execute_module(\n        &self,\n        module_name: &str,\n        _workspace_dir: &Path,\n        _caps: &WasmCapabilities,\n    ) -> Result<WasmExecutionResult> {\n        bail!(\n            \"WASM runtime is not available in this build. \\\n             Rebuild with `cargo build --features runtime-wasm` to enable WASM sandbox support. \\\n             Module requested: {module_name}\"\n        )\n    }\n\n    /// List available WASM tool modules in the tools directory.\n    pub fn list_modules(&self, workspace_dir: &Path) -> Result<Vec<String>> {\n        let tools_path = self.tools_dir(workspace_dir);\n        if !tools_path.exists() {\n            return Ok(Vec::new());\n        }\n\n        let mut modules = Vec::new();\n        for entry in std::fs::read_dir(&tools_path)\n            .with_context(|| format!(\"Failed to read tools dir: {}\", tools_path.display().to_string()))?\n        {\n            let entry = entry?;","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/platform/wasm.rs#L213-L249","documentation":"When the zeroclaw-runtime is compiled without the runtime-wasm cargo feature, WasmPlatform::execute_module is a stub whose only body is this bail: it names the missing feature, the rebuild command, and the requested module. This keeps the platform API compilable in slim builds while making any accidental WASM-tool invocation a loud, actionable error instead of a silent no-op.","triggerScenarios":"Running the default/slim zeroclaw build and invoking a wasm tool; deploying a package built without --features runtime-wasm; a dependency pulling in zeroclaw-runtime with default features and calling execute_module.","commonSituations":"Distro/package-manager builds that strip heavy optional dependencies (wasmer); Docker images built with a minimal feature set; upgrading from a full-featured build to a slim one without realizing tools were wasm-based.","solutions":["Rebuild with the feature: cargo build --features runtime-wasm (or add it to your build script/install command for zeroclaw)","If installing from a package, pick the variant that includes wasm support","If wasm tools are not needed in this deployment, stop invoking them — use native runtime tooling instead","Gate wasm tool paths in your own code with cfg!(feature = \"runtime-wasm\") so the failure is compile-time visible"],"exampleFix":"# before\ncargo build --release\n\n# after\ncargo build --release --features runtime-wasm","handlingStrategy":"validation","validationCode":"if !cfg!(feature = \"runtime-wasm\") {\n    // compile-time known: skip/disable wasm tool paths instead of calling execute_module\n    return Ok(default_without_wasm_tools());\n}","typeGuard":null,"tryCatchPattern":"Err(e) if e.to_string().contains(\"not available in this build\") => {\n    // deployment mismatch: rebuild with --features runtime-wasm or drop the wasm tool path\n}","preventionTips":["Encode the feature set in build scripts/installers so environments are consistent","Gate wasm-dependent code with #[cfg(feature = \"runtime-wasm\")] so misuse fails at compile time","Document which published builds include wasm support"],"tags":["rust","zeroclaw","wasm","cargo-features","build-configuration"],"backgroundTag":"feature-not-enabled","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}