{"record":{"id":"490989f93b20cc7b","repo":"astrid-runtime/astrid","slug":"cargo-include-must-be-a-string-array-or-table-in","errorCode":null,"errorMessage":"Cargo include must be a string, array, or table in {}","messagePattern":"Cargo include must be a string, array, or table in (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust/config.rs","lineNumber":276,"sourceCode":"            .and_then(toml_edit::Item::as_str)\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Cargo include table must contain a string path in {}\",\n                    path.display()\n                )\n            })?;\n        let optional = match table.get(\"optional\") {\n            None => false,\n            Some(value) => value.as_bool().ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Cargo include optional must be a boolean in {}\",\n                    path.display()\n                )\n            })?,\n        };\n        return Ok(vec![resolve_cargo_config_include(path, include, optional)?]);\n    }\n    bail!(\n        \"Cargo include must be a string, array, or table in {}\",\n        path.display()\n    )\n}\n\nfn resolve_cargo_config_include(\n    including_file: &Path,\n    include: &str,\n    optional: bool,\n) -> Result<Option<PathBuf>> {\n    if include.is_empty() {\n        bail!(\"Cargo include path cannot be empty\");\n    }\n    let parent = including_file\n        .parent()\n        .context(\"Cargo configuration file has no parent directory\")?;\n    let candidate = parent.join(include);\n    let resolved = match candidate.canonicalize() {","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust/config.rs#L258-L294","documentation":"Type-dispatch fallback in cargo_config_includes: the Cargo include item in the config file is not a string, not an array, and not a table — the three supported shapes. Reached when e.g. an include is declared as an integer or boolean. The error names the offending config file so the user can fix the TOML type.","triggerScenarios":"Thrown at crates/astrid-build/src/rust/config.rs:276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add `path = \"other-config.toml\"` to the include table","Or use the plain string include form","Fix the config file syntax and retry"],"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"}