jdx/mise · error

bootstrap resource ' ' depends on missing resource

Error message

bootstrap resource '{}' depends on missing resource '{}'

What it means

When BootstrapPlan::ordered topologically sorts resources for execution, it validates every dependency and ordering edge points at a declared resource. If a resource's depends_on or order_after names an id absent from the plan, planning fails with this error naming both the dependent and the missing resource. This is the final safety net before building the execution order.

Solutions

  1. The message names both resources; open the bootstrap config and find the dependent's depends_on/order_after list.
  2. Declare the missing resource, or remove/fix the reference to it.
  3. If the resource is conditionally generated, ensure the condition also applies to the referencing resource.
  4. Re-run the bootstrap plan; ordering should now resolve without bailing.

Example fix

# before
[[bootstrap.resources]]
id = "app"
depends_on = ["db"]  # 'db' not declared
# after
[[bootstrap.resources]]
id = "db"
[[bootstrap.resources]]
id = "app"
depends_on = ["db"]
Defensive patterns

Strategy: validation

Validate before calling

# Check both depends_on and order_after reference declared ids
for dep in $(grep -oP '(?<=\[")[^"]+(?="\])' mise.toml | sort -u); do
  grep -q "id = \"$dep\"" mise.toml || echo "missing resource: $dep"
done

Prevention

When it happens

Trigger: `mise bootstrap` plan output (ordered) where a declared resource references a missing id via depends_on or order_after and the earlier insert/add_dependency guards didn't catch it (edge discovered during graph construction).

Common situations: Config generated or templated with conditional resources where one branch was skipped but its dependents remained; cross-file references where the referenced resource's file wasn't included; stale ids after refactors.

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/543f4dfe2869a511. Report an issue: GitHub.

Appendix: source

Thrown at src/system/resources.rs:277

        Ok(())
    }

    fn ordered(&self) -> Result<Vec<&ResourcePlan>> {
        let mut incoming = self
            .resources
            .keys()
            .cloned()
            .map(|id| (id, 0_usize))
            .collect::<IndexMap<_, _>>();
        let mut outgoing: HashMap<ResourceId, Vec<ResourceId>> = HashMap::new();

        for resource in self.resources.values() {
            for dependency in resource.depends_on.iter().chain(&resource.order_after) {
                let Some(count) = incoming.get_mut(&resource.id) else {
                    unreachable!("every resource was added to incoming")
                };
                if !self.resources.contains_key(dependency) {
                    bail!(
                        "bootstrap resource '{}' depends on missing resource '{}'",
                        resource.id,
                        dependency
                    );
                }
                *count += 1;
                outgoing
                    .entry(dependency.clone())
                    .or_default()
                    .push(resource.id.clone());
            }
        }

        let mut ready = incoming
            .iter()
            .filter_map(|(id, count)| (*count == 0).then_some(id.clone()))
            .collect::<VecDeque<_>>();
        let mut ordered = Vec::with_capacity(self.resources.len());

View on GitHub (pinned to 533346cc37)