{"record":{"id":"c1e192e076af015e","repo":"jdx/mise","slug":"relative-path-syntax-is-not-supported-use-c1e192","errorCode":null,"errorMessage":"relative path syntax '{}' is not supported, use '//{}' or ':task' for current directory","messagePattern":"relative path syntax '(.+?)' is not supported, use '//(.+?)' or ':task' for current directory","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_load_context.rs","lineNumber":193,"sourceCode":"///\n/// # Returns\n/// * `Ok(String)` - The expanded task pattern (e.g., \"//project:build\")\n/// * `Err` - If monorepo is not configured or current directory is outside monorepo root\npub(crate) fn expand_colon_task_syntax(\n    task: &str,\n    config: &crate::config::Config,\n) -> eyre::Result<String> {\n    // Skip expansion for absolute monorepo paths or explicit global tasks\n    if task.starts_with(\"//\") || task.starts_with(\"::\") || is_workspace_project_task(task) {\n        return Ok(task.to_string());\n    }\n\n    // Check if this is a colon pattern or a bare name\n    let is_colon_pattern = task.starts_with(':');\n\n    // Reject patterns that look like monorepo paths with wrong syntax (have / and : but don't start with // or :)\n    if !is_colon_pattern && task.contains('/') && task.contains(':') {\n        bail!(\n            \"relative path syntax '{}' is not supported, use '//{}' or ':task' for current directory\",\n            task,\n            task\n        );\n    }\n\n    // Get the monorepo root config file.\n    let monorepo_root = config\n        .config_files\n        .values()\n        .find(|cf| cf.monorepo_root() == Some(true))\n        .and_then(|cf| cf.project_root());\n\n    // If not in monorepo context, only expand if it's a colon pattern (error), otherwise return as-is\n    if monorepo_root.is_none() {\n        if is_colon_pattern {\n            bail!(\"Cannot use :task syntax without a monorepo root\");\n        }","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_load_context.rs#L175-L211","documentation":"expand_colon_task_syntax validates task reference syntax for monorepos. A string containing both '/' and ':' that does not start with ':' or '//' is ambiguous legacy relative-path syntax that mise no longer supports, so it bails and tells you the two accepted forms: '//path:task' or ':task' for the current directory.","triggerScenarios":"Calling mise run/task with a task reference like `sub/dir:task` or `./dir:task` (a path with a slash AND a colon that starts with neither '//' nor ':').","commonSituations":"Migrating from older mise syntax where `dir:task` meant a relative monorepo path; copy-pasting task refs from docs of other tools; typos missing one '/' in '//dir:task'.","solutions":["Prefix the path with '//': `mise run //sub/dir:task`","Use ':task' syntax from within the subdirectory: cd sub/dir && mise run :task","Remove the slash if you meant a bare task name: `mise run task`","Update scripts/docs that still use the old `dir:task` relative syntax"],"exampleFix":"// before\nmise run sub/dir:build\n// after\nmise run //sub/dir:build","handlingStrategy":"validation","validationCode":"[[ \"$TASK\" == */*:* ]] && [[ \"$TASK\" != //* && \"$TASK\" != :* ]] && echo \"use '//path:task' or ':task'\" || true","typeGuard":null,"tryCatchPattern":"if mise run \"$TASK\" 2>&1 | grep -q 'relative path syntax'; then TASK=\"//$TASK\"; mise run \"$TASK\"; fi","preventionTips":["Never write 'dir:task'; use '//dir:task' for paths","Use ':task' only when cd'd into the package","Update old scripts after mise syntax changes","Add shell completion usage instead of hand-typing paths"],"tags":["tasks","monorepo","syntax"],"backgroundTag":"invalid-argument-format","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"}