{"record":{"id":"be61916a6770f258","repo":"astrid-runtime/astrid","slug":"capsule-toml-declares-components-but-this-buil","errorCode":null,"errorMessage":"Capsule.toml declares {} components, but this build packages exactly one cdylib","messagePattern":"Capsule\\.toml declares (.+?) components, but this build packages exactly one cdylib","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust.rs","lineNumber":736,"sourceCode":"    validate_wasm_output_name(packaged_name.strip_suffix(\".wasm\").unwrap_or(packaged_name))?;\n\n    let Some(component_item) = toml_doc.get_mut(\"component\") else {\n        let mut component = toml_edit::Table::new();\n        let component_id = packaged_name.strip_suffix(\".wasm\").unwrap_or(packaged_name);\n        component.insert(\"id\", toml_edit::value(component_id));\n        component.insert(\"file\", toml_edit::value(packaged_name));\n        component.insert(\"type\", toml_edit::value(\"executable\"));\n        let mut components = toml_edit::ArrayOfTables::new();\n        components.push(component);\n        toml_doc.insert(\"component\", toml_edit::Item::ArrayOfTables(components));\n        return Ok(());\n    };\n\n    let Some(components) = component_item.as_array_of_tables_mut() else {\n        bail!(\"Capsule.toml component must be an array of tables\")\n    };\n    if components.len() != 1 {\n        bail!(\n            \"Capsule.toml declares {} components, but this build packages exactly one cdylib\",\n            components.len()\n        );\n    }\n    let component = components\n        .get_mut(0)\n        .context(\"Capsule.toml component array unexpectedly empty\")?;\n    let has_file = component.get(\"file\").is_some();\n    let has_entrypoint = component.get(\"entrypoint\").is_some();\n    if has_file && has_entrypoint {\n        bail!(\n            \"Capsule.toml component declares both `file` and `entrypoint`; refusing an ambiguous executable path\"\n        );\n    }\n\n    let key = if has_file {\n        \"file\"\n    } else if has_entrypoint {","sourceCodeStart":718,"sourceCodeEnd":754,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust.rs#L718-L754","documentation":"Fired by bind_manifest_to_packaged_wasm when Capsule.toml lists a number of components other than one, but this build packages exactly a single cdylib. The manifest would describe components that do not exist in the archive.","triggerScenarios":"Thrown at crates/astrid-build/src/rust.rs:736 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Trim Capsule.toml to exactly one `[[component]]` entry","Remove the component section entirely so the build writes a default one","Split the build if you genuinely need multi-component capsules"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}