jdx/mise · error

cannot add dependency to missing bootstrap resource

Error message

cannot add dependency to missing bootstrap resource '{resource}'

What it means

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.

Solutions

  1. Locate the resource that depends on the missing id and check the id spelling.
  2. Either declare the missing resource in the bootstrap config or remove the dependency edge.
  3. Re-run the bootstrap plan to confirm the dependency graph resolves.
  4. Use the plan/dry-run output to list all declared ids before editing dependencies.

Example fix

# before: depends on undeclared resource
[[bootstrap.resources]]
id = "dotfiles"
depends_on = ["packages"]  # 'packages' never declared
# after: declare it
[[bootstrap.resources]]
id = "packages"
[[bootstrap.resources]]
id = "dotfiles"
depends_on = ["packages"]
Defensive patterns

Strategy: validation

Validate before calling

# Verify every depends_on id is declared
for dep in $(grep -oP '(?<=depends_on = \[")[^"]+' mise.toml); do
  grep -q "id = \"$dep\"" mise.toml || echo "missing resource: $dep"
done

Prevention

When it happens

Trigger: `mise bootstrap` planning where a resource declares a dependency on an id not declared anywhere in the config (typo, deleted resource, wrong file included).

Common situations: 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.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/2f645185e05d44fc. Report an issue: GitHub.

Appendix: source

Thrown at src/system/resources.rs:235

impl BootstrapPlan {
    pub(crate) fn insert(&mut self, resource: ResourcePlan) -> Result<()> {
        if self.resources.contains_key(&resource.id) {
            bail!(
                "bootstrap resource '{}' is declared more than once",
                resource.id
            );
        }
        self.resources.insert(resource.id.clone(), resource);
        Ok(())
    }

    pub(crate) fn add_dependency(
        &mut self,
        resource: &ResourceId,
        dependency: ResourceId,
    ) -> Result<()> {
        let Some(resource) = self.resources.get_mut(resource) else {
            bail!("cannot add dependency to missing bootstrap resource '{resource}'");
        };
        if !resource.depends_on.contains(&dependency) {
            resource.depends_on.push(dependency);
        }
        Ok(())
    }

    pub(crate) fn output(&self) -> Result<BootstrapPlanOutput<'_>> {
        let resources = self.ordered()?;
        let mut summary = PlanSummary::default();
        for resource in &resources {
            summary.add(resource.action);
        }
        Ok(BootstrapPlanOutput { resources, summary })
    }

    fn add_ordering(&mut self, resource: &ResourceId, predecessor: ResourceId) -> Result<()> {
        let Some(resource) = self.resources.get_mut(resource) else {

View on GitHub (pinned to 533346cc37)