{"record":{"id":"7b22c1c9b49561e2","repo":"jdx/mise","slug":"task-not-found","errorCode":null,"errorMessage":"task not found: {}","messagePattern":"task not found: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_executor.rs","lineNumber":1001,"sourceCode":"            let (name, _) = split_task_spec(s);\n            name\n        }));\n        let tasks = config.tasks_with_context(Some(&ctx)).await?;\n        let tasks_map: BTreeMap<String, Task> = tasks\n            .values()\n            .flat_map(|t| {\n                t.aliases\n                    .iter()\n                    .map(|a| (a.to_string(), t.clone()))\n                    .chain(once((t.name.clone(), t.clone())))\n                    .collect::<Vec<_>>()\n            })\n            .collect();\n        let mut to_run: Vec<Task> = vec![];\n        for spec in specs {\n            let (name, args) = split_task_spec(spec);\n            let matches = tasks_map.get_matching(name)?;\n            ensure!(!matches.is_empty(), \"task not found: {}\", name);\n            for t in matches {\n                let mut t = (*t).clone();\n                t.args = override_args\n                    .map(|a| a.to_vec())\n                    .unwrap_or_else(|| args.clone());\n                // Apply entry-level env via with_dependency_env (high priority,\n                // consistent with depends/depends_post) so it overrides the\n                // sub-task's own declared env.\n                if let Some(env) = override_env {\n                    let env_directives: Vec<EnvDirective> = env\n                        .iter()\n                        .map(|(k, v)| EnvDirective::Val(k.clone(), v.clone(), Default::default()))\n                        .collect();\n                    t = t.with_dependency_env(&env_directives);\n                    if let Some(config_root) = &t.config_root {\n                        let env_map: IndexMap<String, String> = env.iter().cloned().collect();\n                        t.outputs.re_render_with_env(\n                            &t.raw_outputs.clone(),","sourceCodeStart":983,"sourceCodeEnd":1019,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/task_executor.rs#L983-L1019","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Run `mise tasks ls` to list available tasks and check the spelling","Verify the task is defined in a config file mise loads (mise.toml in cwd or an ancestor, or ~/.config/mise)","If the task lives in another directory, run from there or use the task's qualified path/`dir` attribute","Ensure the config file is trusted (`mise trust`) and not excluded"],"exampleFix":"// before\nmise run biuld\n// after\nmise run build   # or: mise tasks ls to find the right name","handlingStrategy":"validation","validationCode":"mise tasks ls | grep -x \"$TASK\" || echo \"task $TASK not defined\"","typeGuard":null,"tryCatchPattern":"if mise run \"$TASK\" 2>&1 | grep -q 'task not found'; then mise tasks ls; fi","preventionTips":["Run `mise tasks ls` to verify names before scripting","Use shell completion for task names","Keep task definitions in config files reachable from your cwd"],"tags":["tasks","cli","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}