jdx/mise · error

Task not found: {task_spec}, use `mise tasks ls --all --hidd

Error message

Task not found: {task_spec}, use `mise tasks ls --all --hidden` to list all tasks

What it means

resolve_tasks (src/cli/cache/task.rs:129) is the task resolver behind 'mise cache task': it expands colon syntax (//workspace and project tasks), loads all tasks plus aliases via build_task_ref_map, and if get_matching() yields nothing for the spec it bails, pointing at 'mise tasks ls --all --hidden' to enumerate what actually loaded.

Source

Thrown at src/cli/cache/task.rs:129

    let config = Config::get().await?;
    let task_name = crate::task::expand_colon_task_syntax(task_spec, &config)?;
    let tasks = if task_name.starts_with("//") {
        let ctx = crate::task::TaskLoadContext::from_pattern(&task_name);
        config.tasks_with_context(Some(&ctx)).await?
    } else if crate::task::is_workspace_project_task(&task_name) {
        let ctx = crate::task::TaskLoadContext::all();
        config.tasks_with_context(Some(&ctx)).await?
    } else {
        config.tasks().await?
    };
    let tasks_with_aliases = crate::task::build_task_ref_map(tasks.iter());
    let mut tasks = tasks_with_aliases
        .get_matching(&task_name)?
        .into_iter()
        .map(|task| (**task).clone())
        .collect_vec();
    if tasks.is_empty() {
        bail!("Task not found: {task_spec}, use `mise tasks ls --all --hidden` to list all tasks");
    }
    TaskFetcher::new(false)
        .fetch_tasks(&config, &mut tasks)
        .await?;
    Ok((config, tasks))
}

fn format_timestamp(timestamp: u64) -> String {
    i64::try_from(timestamp)
        .ok()
        .and_then(|timestamp| DateTime::<Utc>::from_timestamp(timestamp, 0))
        .map(|timestamp| timestamp.to_rfc3339_opts(SecondsFormat::Secs, true))
        .unwrap_or_else(|| "unknown".to_string())
}

View on GitHub (pinned to 9dcfcaa0dc)

Solutions

  1. Run 'mise tasks ls --all --hidden' and copy the exact name (the error suggests this)
  2. Run from the project root, or use the // form for workspace tasks: 'mise cache task //pkg:build ...'
  3. Verify the task file parses and is discovered: 'mise tasks ls' should list it; fix TOML errors
  4. Check aliases: the spec must match the task name or one of its aliases

Example fix

# before
mise cache task biuld warm
# Error: Task not found: biuld, use `mise tasks ls --all --hidden` to list all tasks

# after
mise tasks ls --all --hidden
mise cache task build warm
Defensive patterns

Strategy: validation

Validate before calling

# bash: assert the task exists before warming its cache
mise tasks ls --all --hidden 2>/dev/null | awk '{print $1}' | grep -qx "$TASK" || { echo "task not found: $TASK" >&2; exit 1; }

Prevention

When it happens

Trigger: 'mise cache task <name> <cmd>' where <name> is not defined in mise.toml [tasks], tasks/ files, or plugins; running outside the project so no tasks load; a workspace task referenced without the // prefix; a typo or a removed alias.

Common situations: Running from a subdirectory or the wrong repo; task files with invalid TOML that load zero tasks; renamed or deleted tasks; monorepo tasks addressed with the wrong prefix.

Related errors


AI-assisted analysis of jdx/mise@9dcfcaa0dc (2026-08-17). Data as JSON: /api/errors/f4fb0024055ac7f1. Report an issue: GitHub.