{"record":{"id":"d92fca6146ad1675","repo":"jdx/mise","slug":"no-tasks-defined-in-are-you-in-a-project-direc","errorCode":null,"errorMessage":"no tasks defined in {}. Are you in a project directory?","messagePattern":"no tasks defined in (.+?)\\. Are you in a project directory\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_list.rs","lineNumber":355,"sourceCode":"            if let Some(first) = non_exec_files.first() {\n                let dirs_with_files: Vec<String> = includes\n                    .iter()\n                    .filter(|d| d.is_dir())\n                    .map(display_path)\n                    .collect();\n                bail!(\n                    \"no tasks defined in {}, but found {} non-executable file(s) in {}.\\n\\\n                        Files must be executable to be detected as tasks.\\n\\\n                        {}\",\n                    display_path(dirs::CWD.clone().unwrap_or_default()),\n                    non_exec_files.len(),\n                    dirs_with_files.join(\", \"),\n                    file::make_executable_hint(first),\n                );\n            }\n        }\n\n        bail!(\n            \"no tasks defined in {}. Are you in a project directory?\",\n            display_path(dirs::CWD.clone().unwrap_or_default())\n        );\n    }\n    if let Some(task) = make_task_executable(config, name, task_context).await? {\n        return Ok(Some(task));\n    }\n\n    // Suggest similar tasks using fuzzy matching for monorepo tasks\n    let mut err_msg = format!(\"no task {} found\", style::ered(name));\n\n    let similar = similar_tasks(name, &tasks_for_error);\n    if !similar.is_empty() {\n        err_msg.push_str(\"\\n\\nDid you mean one of these?\");\n        for task_name in similar {\n            err_msg.push_str(&format!(\"\\n  - {}\", task_name));\n        }\n    }","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_list.rs#L337-L373","documentation":"Terminal case of err_no_task: no tasks are defined anywhere in scope, no non-executable candidates exist, and no similar subcommand matched — the directory simply has no tasks, and the message asks whether you are in the intended project directory.","triggerScenarios":"Thrown at src/task/task_list.rs:355 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["cd into the project that defines the tasks","Create a task (mise.toml [tasks] block or a file in mise-tasks/)","Run `mise tasks` to list what mise can see from here"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}