{"record":{"id":"608b5470fb9c54d9","repo":"unicity-aos/aos-ce","slug":"no-component-with-a-file-was-found","errorCode":null,"errorMessage":"No [[component]] with a `file` was found.","messagePattern":"No \\[\\[component\\]\\] with a `file` was found\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"capsules/capsule-forge/src/checks.rs","lineNumber":171,"sourceCode":"        )),\n        None => out.push(Finding::err(\n            \"[package].version is missing.\",\n            \"Add `version = \\\"0.1.0\\\"` under [package].\",\n        )),\n    }\n}\n\nfn check_component(root: &Toml, out: &mut Vec<Finding>) {\n    let comps = root.get(\"component\").and_then(Toml::as_array);\n    let has_file = comps.is_some_and(|arr| {\n        arr.iter().any(|c| {\n            c.get(\"file\")\n                .and_then(Toml::as_str)\n                .is_some_and(|f| !f.is_empty())\n        })\n    });\n    if !has_file {\n        out.push(Finding::err(\n            \"No [[component]] with a `file` was found.\",\n            \"Add a [[component]] table with `id`, `file = \\\"my_capsule.wasm\\\"`, `type = \\\"executable\\\"`.\",\n        ));\n    }\n}\n\nfn check_env(root: &Toml, out: &mut Vec<Finding>) {\n    let Some(env) = root.get(\"env\").and_then(Toml::as_table) else {\n        return;\n    };\n    for (key, val) in env {\n        if val.get(\"scope\").and_then(Toml::as_str) == Some(\"shared\") {\n            out.push(Finding::warn(\n                format!(\"[env].{key} sets scope = \\\"shared\\\", which is silently ignored.\"),\n                \"Remove `scope`; shared/operator-only env scope is not honoured from the manifest.\",\n            ));\n        }\n    }","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/capsules/capsule-forge/src/checks.rs#L153-L189","documentation":"`check_component` scans all `[[component]]` entries and requires at least one to have a non-empty `file` string pointing at the capsule's WASM artifact. If none does (`has_file` is false), this error is emitted. Without a component file the manifest does not describe a runnable capsule.","triggerScenarios":"Capsule.toml with no [[component]] sections at all; [[component]] entries missing the `file` key; or `file = \"\"` (empty strings fail the `!f.is_empty()` test).","commonSituations":"Generating a manifest stub without the component table, renaming the WASM output and deleting the file key, or leaving a placeholder empty value before the build produced the artifact.","solutions":["Add a [[component]] table with `id`, `file = \"my_capsule.wasm\"`, and `type = \"executable\"`.","If a [[component]] exists, add its `file` key pointing to the built WASM path.","Ensure the file value is non-empty and matches the actual artifact name after `capsule-forge` build."],"exampleFix":"// before\n[[component]]\nid = \"main\"\n\n// after\n[[component]]\nid = \"main\"\nfile = \"my_capsule.wasm\"\ntype = \"executable\"","handlingStrategy":"validation","validationCode":"// Rust\nlet has_file = root.get(\"component\")\n    .and_then(|c| c.as_array())\n    .map_or(false, |cs| cs.iter().any(|c|\n        c.get(\"file\").and_then(|f| f.as_str()).map_or(false, |f| !f.is_empty())));\nif !has_file { return Err(\"no [[component]] with a file\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add the [[component]] block with id/file/type immediately when creating a manifest.","Keep the `file` value in sync with the WASM artifact name emitted by the build.","Run the forge lint before packaging a capsule."],"tags":["toml","schema-validation","wasm","config"],"backgroundTag":"missing-required-config-field","analyzedSha":"f6f22024fb1e8d122f28a1b4a9f75aee448ae839","analyzedAt":"2026-09-13T03:04:44.565Z","contentChangedAt":"2026-09-13T03:04:44.565Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}