{"record":{"id":"2f645185e05d44fc","repo":"jdx/mise","slug":"cannot-add-dependency-to-missing-bootstrap-resourc","errorCode":null,"errorMessage":"cannot add dependency to missing bootstrap resource '{resource}'","messagePattern":"cannot add dependency to missing bootstrap resource '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/resources.rs","lineNumber":235,"sourceCode":"impl BootstrapPlan {\n    pub(crate) fn insert(&mut self, resource: ResourcePlan) -> Result<()> {\n        if self.resources.contains_key(&resource.id) {\n            bail!(\n                \"bootstrap resource '{}' is declared more than once\",\n                resource.id\n            );\n        }\n        self.resources.insert(resource.id.clone(), resource);\n        Ok(())\n    }\n\n    pub(crate) fn add_dependency(\n        &mut self,\n        resource: &ResourceId,\n        dependency: ResourceId,\n    ) -> Result<()> {\n        let Some(resource) = self.resources.get_mut(resource) else {\n            bail!(\"cannot add dependency to missing bootstrap resource '{resource}'\");\n        };\n        if !resource.depends_on.contains(&dependency) {\n            resource.depends_on.push(dependency);\n        }\n        Ok(())\n    }\n\n    pub(crate) fn output(&self) -> Result<BootstrapPlanOutput<'_>> {\n        let resources = self.ordered()?;\n        let mut summary = PlanSummary::default();\n        for resource in &resources {\n            summary.add(resource.action);\n        }\n        Ok(BootstrapPlanOutput { resources, summary })\n    }\n\n    fn add_ordering(&mut self, resource: &ResourceId, predecessor: ResourceId) -> Result<()> {\n        let Some(resource) = self.resources.get_mut(resource) else {","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/resources.rs#L217-L253","documentation":"BootstrapPlan::add_dependency wires a `depends_on` edge between two resources during planning. If the target resource id was never inserted into the plan, the planner bails: you cannot attach a dependency to a resource that doesn't exist. This catches config typos and references to removed resources before execution.","triggerScenarios":"`mise bootstrap` planning where a resource declares a dependency on an id not declared anywhere in the config (typo, deleted resource, wrong file included).","commonSituations":"Renaming a resource id but not updating dependents' depends_on lists; deleting a package entry that file resources still reference; merging config files and losing a resource declaration.","solutions":["Locate the resource that depends on the missing id and check the id spelling.","Either declare the missing resource in the bootstrap config or remove the dependency edge.","Re-run the bootstrap plan to confirm the dependency graph resolves.","Use the plan/dry-run output to list all declared ids before editing dependencies."],"exampleFix":"# before: depends on undeclared resource\n[[bootstrap.resources]]\nid = \"dotfiles\"\ndepends_on = [\"packages\"]  # 'packages' never declared\n# after: declare it\n[[bootstrap.resources]]\nid = \"packages\"\n[[bootstrap.resources]]\nid = \"dotfiles\"\ndepends_on = [\"packages\"]","handlingStrategy":"validation","validationCode":"# Verify every depends_on id is declared\nfor dep in $(grep -oP '(?<=depends_on = \\[\")[^\"]+' mise.toml); do\n  grep -q \"id = \\\"$dep\\\"\" mise.toml || echo \"missing resource: $dep\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When renaming a resource id, grep for its old name in all depends_on lists.","Never delete a resource before removing references to it.","Keep dependencies and their dependents in the same config file where possible.","Use the plan step to validate the graph before apply."],"tags":["bootstrap","config","dependency"],"backgroundTag":"missing-dependency","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}