jdx/mise · error

task not found

Error message

task not found: {}

What it means

When resolving task dependencies/references in `task_executor.rs`, each spec is looked up in the loaded tasks map via `get_matching(name)`. If no task (or alias) matches the given name, mise aborts with `task not found: <name>` rather than guessing.

Solutions

  1. Run `mise tasks` to list available tasks and correct the name/typo.
  2. Fix the `depends`/invocation reference to match the actual task name or alias.
  3. Ensure the config file defining the task is included (correct cwd, `[tasks]` section present, file trusted).

Example fix

// before (mise.toml)
[depends]
tasks = ["buld"]

// after
[depends]
tasks = ["build"]
Defensive patterns

Strategy: validation

Validate before calling

mise tasks list | grep -qx "$name" && mise run "$name"

Try / catch

if ! mise tasks list | grep -qx "$task"; then echo "task '$task' not defined" >&2; exit 1; fi
mise run "$task"

Prevention

When it happens

Trigger: Running `mise run <name>` or a task's `depends` list containing a name where `tasks_map.get_matching(name)` returns an empty vec — the task file is absent, the name is misspelled, or the task is defined in a directory not scanned.

Common situations: Typo in `mise run` argument; a `depends = ["other"]` referencing a task deleted or renamed; task defined in another workspace/directory excluded from config; running from a directory without mise.toml tasks.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at src/task/task_executor.rs:1003

            let (name, _) = split_task_spec(s);
            name
        }));
        let tasks = config.tasks_with_context(Some(&ctx)).await?;
        let tasks_map: BTreeMap<String, Task> = tasks
            .values()
            .flat_map(|t| {
                t.aliases
                    .iter()
                    .map(|a| (a.to_string(), t.clone()))
                    .chain(once((t.name.clone(), t.clone())))
                    .collect::<Vec<_>>()
            })
            .collect();
        let mut to_run: Vec<Task> = vec![];
        for spec in specs {
            let (name, args) = split_task_spec(spec);
            let matches = tasks_map.get_matching(name)?;
            ensure!(!matches.is_empty(), "task not found: {}", name);
            for t in matches {
                let mut t = (*t).clone();
                t.args = override_args
                    .map(|a| a.to_vec())
                    .unwrap_or_else(|| args.clone());
                // Apply entry-level env via with_dependency_env (high priority,
                // consistent with depends/depends_post) so it overrides the
                // sub-task's own declared env.
                if let Some(env) = override_env {
                    let env_directives: Vec<EnvDirective> = env
                        .iter()
                        .map(|(k, v)| EnvDirective::Val(k.clone(), v.clone(), Default::default()))
                        .collect();
                    t = t.with_dependency_env(&env_directives);
                    if let Some(config_root) = t.config_root.clone() {
                        let env_map: IndexMap<String, String> = env.iter().cloned().collect();
                        t.outputs.re_render_with_env(
                            &mut t.raw_outputs,

View on GitHub (pinned to 533346cc37)