{"record":{"id":"57e4b6e61feb5506","repo":"wasmerio/wasmer","slug":"the-package-doesn-t-contain-any-bindings","errorCode":null,"errorMessage":"The package doesn't contain any bindings","messagePattern":"The package doesn't contain any bindings","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lib/cli/src/commands/add.rs","lineNumber":121,"sourceCode":"    language: &ProgrammingLanguage,\n) -> Result<Bindings, Error> {\n    let all_bindings = wasmer_backend_api::query::list_bindings(\n        client,\n        &pkg.name,\n        pkg.version_opt().map(|v| v.to_string()).as_deref(),\n    )\n    .await?;\n\n    match all_bindings.iter().find(|b| b.language == *language) {\n        Some(b) => {\n            let Bindings { url, generator, .. } = b;\n            log::debug!(\"Found {pkg} bindings generated by {generator:?} at {url}\");\n\n            Ok(b.clone())\n        }\n        None => {\n            if all_bindings.is_empty() {\n                anyhow::bail!(\"The package doesn't contain any bindings\");\n            } else {\n                todo!();\n            }\n        }\n    }\n}\n\n#[derive(Debug, Copy, Clone)]\nenum Target {\n    Pip,\n    Yarn { dev: bool },\n    Npm { dev: bool },\n    Pnpm { dev: bool },\n}\n\nimpl Target {\n    fn language(self) -> ProgrammingLanguage {\n        match self {","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/cli/src/commands/add.rs#L103-L139","documentation":"When resolving bindings for a package (used by `wasmer add` to generate typed bindings), lookup_bindings_for_package found no bindings at all in the package's wasmer.toml/manifest and bails. The library throws this because the command's purpose is to produce bindings and the package simply has none.","triggerScenarios":"Running `wasmer add <package>` where the target package's manifest declares no [bindings] sections, so all_bindings is empty.","commonSituations":"Adding a plain WASM package that was published without binding generator config; typos in the bindings kind; older packages published before bindings support.","solutions":["Verify the package's manifest (wasmer.toml) actually contains a [[bindings]] section with a valid generator (e.g. js, pyo3) and republish if you own it.","Reference the correct package name/version that is known to ship bindings.","If you only need the wasm module, consume it directly instead of via the bindings-adding command."],"exampleFix":"// before: wasmer.toml without bindings -> 'The package doesn't contain any bindings'\n// after: add to wasmer.toml\n// [[bindings]]\n// name = \"mybindings\"\n// kind = \"js\"\n// package = \"my/package\"\n","handlingStrategy":"validation","validationCode":"// check the package manifest exposes bindings before running `wasmer add`\nlet manifest = wasmer_config::package::Package::parse(&toml_text)?;\nif manifest.bindings.is_empty() {\n    eprintln!(\"package has no [[bindings]]; skipping add\");\n}","typeGuard":"fn has_bindings(manifest: &PackageManifest) -> bool {\n    !manifest.bindings.is_empty()\n}","tryCatchPattern":"match lookup_bindings_for_package(...) {\n    Ok(b) => b,\n    Err(e) if e.to_string().contains(\"doesn't contain any bindings\") => {\n        eprintln!(\"no bindings in package; using raw wasm module instead\");\n        Default::default()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Inspect a package's wasmer.toml for [[bindings]] before adding it.","Publish packages with a bindings section if consumers need typed access.","Verify package name/version to avoid adding an unintended bindings-less variant."],"tags":["wasmer","bindings","package-manifest"],"backgroundTag":"missing-package-bindings","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}