jdx/mise · error

task not found: {}

Error message

task not found: {}

What it means

Lookup failure in task execution setup: a requested task spec (after splitting off args) was not found in the resolved tasks map, which indexes tasks by name and aliases. Fires on a misspelled or nonexistent task name passed to mise run/exec.

Source

Thrown at src/task/task_executor.rs:1001

            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 {
                        let env_map: IndexMap<String, String> = env.iter().cloned().collect();
                        t.outputs.re_render_with_env(
                            &t.raw_outputs.clone(),

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Run `mise tasks ls` to list available tasks and check the spelling
  2. Verify the task is defined in a config file mise loads (mise.toml in cwd or an ancestor, or ~/.config/mise)
  3. If the task lives in another directory, run from there or use the task's qualified path/`dir` attribute
  4. Ensure the config file is trusted (`mise trust`) and not excluded

Example fix

// before
mise run biuld
// after
mise run build   # or: mise tasks ls to find the right name
Defensive patterns

Strategy: validation

Validate before calling

mise tasks ls | grep -x "$TASK" || echo "task $TASK not defined"

Try / catch

if mise run "$TASK" 2>&1 | grep -q 'task not found'; then mise tasks ls; fi

Prevention

When it happens

Trigger: Running `mise tasks run <name>` / executing a dependency spec where <name> doesn't exist, is misspelled, or is defined only in a config file that wasn't loaded (wrong directory, untrusted config, ignored workspace).

Common situations: Typo in task name; task defined in a mise.toml in a subdirectory you're not in; using a monorepo task without cd or without `dir` config; shell tab-completion stale after removing a task.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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