{"record":{"id":"f8ba02bface5d3de","repo":"wasmerio/wasmer","slug":"unable-to-determine-the-package-s-entrypoint-plea","errorCode":null,"errorMessage":"Unable to determine the package's entrypoint. Please choose one of {commands:?}","messagePattern":"Unable to determine the package's entrypoint\\. Please choose one of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/wasix/src/bin_factory/binary_package.rs","lineNumber":339,"sourceCode":"                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;\n\n    use crate::{\n        PluggableRuntime,\n        runtime::{package_loader::BuiltinPackageLoader, task_manager::VirtualTaskManager},\n    };","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/wasix/src/bin_factory/binary_package.rs#L321-L357","documentation":"BinaryPackage::infer_entrypoint throws this when the package defines two or more commands and no explicit entrypoint is configured, so the library cannot decide which command to execute. The error message lists all candidate command names so the caller can pick one. It is raised from execute_webc during entrypoint resolution.","triggerScenarios":"Executing a multi-command webc package (commands.len() > 1) without setting entrypoint_cmd or passing an explicit command name to the runner.","commonSituations":"Running `wasmer run package.webc` where the package exports several CLIs (e.g. a package containing both `server` and `cli`) without `wasmer run pkg --command cli`; older manifests where a default entrypoint was not recorded.","solutions":["Pass the desired command explicitly, e.g. `wasmer run pkg.webc --entry <command-name>` (or set entrypoint_cmd in the runner config).","Pick a command name from the list shown in the error message.","If one command should always be the default, rebuild the package marking it as the default entrypoint."],"exampleFix":"// before\nlet pkg = BinaryPackage::from_webc(&webc)?;\nexecute_webc(env, pkg)  // panics/bails: which command?\n\n// after\nlet mut pkg = BinaryPackage::from_webc(&webc)?;\npkg.entrypoint_cmd = Some(\"app\".to_string());\nexecute_webc(env, pkg)","handlingStrategy":"validation","validationCode":"// Rust: resolve the command name before running\nlet cmds: Vec<_> = pkg.commands.iter().map(|c| c.name().to_string()).collect();\nif cmds.len() > 1 && pkg.entrypoint_cmd.is_none() {\n    let chosen = std::env::var(\"APP_CMD\")\n        .ok()\n        .filter(|c| cmds.contains(c))\n        .expect(\"package has multiple commands; set APP_CMD or --entry\");\n    pkg.entrypoint_cmd = Some(chosen);\n}","typeGuard":"fn has_single_or_explicit_entrypoint(pkg: &BinaryPackage) -> bool {\n    pkg.entrypoint_cmd.is_some() || pkg.commands.len() == 1\n}","tryCatchPattern":null,"preventionTips":["Pin the entrypoint via --entry / entrypoint_cmd whenever a package has more than one command.","Document the runnable command names next to the webc artifact.","Mark one command as default when building the package."],"tags":["wasix","webc","entrypoint","ambiguity"],"backgroundTag":"ambiguous-entrypoint","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}