{"record":{"id":"f5ef0f45c4884661","repo":"wasmerio/wasmer","slug":"the-package-doesn-t-contain-any-executable-command","errorCode":null,"errorMessage":"The package doesn't contain any executable commands","messagePattern":"The package doesn't contain any executable commands","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/wasix/src/bin_factory/binary_package.rs","lineNumber":334,"sourceCode":"    ///\n    /// Usually the hash of the entrypoint.\n    pub fn hash(&self) -> ModuleHash {\n        *self.hash.get_or_init(|| {\n            if let Some(cmd) = self.get_entrypoint_command() {\n                cmd.hash\n            } else {\n                ModuleHash::new(self.id.to_string())\n            }\n        })\n    }\n\n    pub fn infer_entrypoint(&self) -> Result<&str, anyhow::Error> {\n        if let Some(entrypoint) = self.entrypoint_cmd.as_deref() {\n            return Ok(entrypoint);\n        }\n\n        match self.commands.as_slice() {\n            [] => anyhow::bail!(\"The package doesn't contain any executable commands\"),\n            [one] => Ok(one.name()),\n            [..] => {\n                let mut commands: Vec<_> = self.commands.iter().map(|cmd| cmd.name()).collect();\n                commands.sort();\n                anyhow::bail!(\n                    \"Unable to determine the package's entrypoint. Please choose one of {commands:?}\"\n                );\n            }\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use sha2::Digest;\n    use tempfile::TempDir;\n    use virtual_fs::AsyncReadExt;\n    use wasmer_package::utils::from_disk;","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/wasix/src/bin_factory/binary_package.rs#L316-L352","documentation":"This error comes from BinaryPackage::infer_entrypoint when a webc package is being executed but its command manifest contains zero commands. The library cannot pick a default executable to run, so it aborts with 'The package doesn't contain any executable commands'. It is thrown during execute_webc -> infer_entrypoint before any WASM is instantiated.","triggerScenarios":"Calling execute_webc (or run/pacakge-level APIs that resolve an entrypoint) on a package whose `commands` list is empty and which has no explicit `entrypoint_cmd` set.","commonSituations":"Building a webc from a container image or data-only package (e.g. assets/shared libraries) with no `[[bin]]`/command entries; packaging tools producing empty manifests; pointing waken at a shared-library webc instead of a CLI webc.","solutions":["Rebuild the webc package with at least one command entry (e.g. `wapc`/`packaged` manifest including a `[[command]]` pointing at a module).","Set the entrypoint explicitly where supported (entrypoint_cmd / --entrypoint flag) if the package intentionally has no default.","Verify you are running the correct webc file — pick one that actually contains a CLI command, not a data/library package."],"exampleFix":"// before (empty command manifest)\n// webc has no [[command]] sections -> infer_entrypoint() bails\n\n// after\n// wapm.toml:\n// [package]\n// name = \"my/cli\"\n// [[module]]\n// name = \"app\"\n// source = \"target/wasm32-wasi/release/app.wasm\"\n// [[command]]\n// name = \"app\"\n// module = \"app\"","handlingStrategy":"validation","validationCode":"// Rust: check the package before executing\nif pkg.commands.is_empty() {\n    return Err(anyhow::anyhow!(\n        \"package '{}' has no executable commands; rebuild the webc with a [[command]] entry\",\n        pkg.name\n    ));\n}","typeGuard":"fn has_entrypoint(pkg: &BinaryPackage) -> bool {\n    pkg.entrypoint_cmd.is_some() || !pkg.commands.is_empty()\n}","tryCatchPattern":null,"preventionTips":["Always include at least one [[command]] in the wapm/webc manifest when building CLI packages.","Set the entrypoint explicitly for multi-purpose or data packages.","CI-check packaged webc files for a non-empty command list before publishing."],"tags":["wasix","webc","entrypoint","packaging"],"backgroundTag":"missing-package-entrypoint","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}