{"record":{"id":"7b22c1c9b49561e2","repo":"jdx/mise","slug":"task-not-found","errorCode":null,"errorMessage":"task not found: {}","messagePattern":"task not found: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_executor.rs","lineNumber":1003,"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.clone() {\n                        let env_map: IndexMap<String, String> = env.iter().cloned().collect();\n                        t.outputs.re_render_with_env(\n                            &mut t.raw_outputs,","sourceCodeStart":985,"sourceCodeEnd":1021,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_executor.rs#L985-L1021","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `mise tasks` to list available tasks and correct the name/typo.","Fix the `depends`/invocation reference to match the actual task name or alias.","Ensure the config file defining the task is included (correct cwd, `[tasks]` section present, file trusted)."],"exampleFix":"// before (mise.toml)\n[depends]\ntasks = [\"buld\"]\n\n// after\n[depends]\ntasks = [\"build\"]","handlingStrategy":"validation","validationCode":"mise tasks list | grep -qx \"$name\" && mise run \"$name\"","typeGuard":null,"tryCatchPattern":"if ! mise tasks list | grep -qx \"$task\"; then echo \"task '$task' not defined\" >&2; exit 1; fi\nmise run \"$task\"","preventionTips":["Run `mise tasks` to confirm names before invoking.","Keep `depends` lists in sync with actual task names.","Use aliases deliberately and document them."],"tags":["task","mise","cli","not-found"],"backgroundTag":"record-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}