{"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 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/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/task/task_load_context.rs#L175-L211","documentation":"During task-name expansion for monorepos, mise rejects strings that mix '/' and ':' without starting with '//' (absolute monorepo path) or ':' (colon pattern). Such strings look like an attempted relative monorepo path, e.g. `packages/web:build`, which is ambiguous — mise demands either `//packages/web:build` (absolute from monorepo root) or `:build` (current package).","triggerScenarios":"Calling `mise run packages/web:build` or `mise packages/web:build` while task expansion is active (a monorepo root config exists). The guard fires before any scoping because the string has both separators but no recognized prefix.","commonSituations":"Migrating from another task runner's path syntax (nx, bazel-like `pkg:target`); assuming relative workspace paths work; copy-pasting task names from docs of other tools.","solutions":["Use the absolute monorepo syntax: `mise //packages/web:build`.","Use the current-directory shorthand `:build` if the task is in the nearest enclosing package.","Use a bare task name `build` and let mise resolve/fuzzy-match it across the monorepo.","Check your monorepo root config has `monorepo = true`-style settings ([monorepo] table / monorepo_root) so scopes resolve as expected."],"exampleFix":"# before\n$ mise run packages/web:build\nerror: relative path syntax 'packages/web:build' is not supported\n\n# after\n$ mise run //packages/web:build\n# or, from inside packages/web:\n$ mise run :build","handlingStrategy":"validation","validationCode":"# reject mixed / and : without // or : prefix before invoking mise\ncase \"$1\" in\n //*|:*) ;;\n *:/*|*/*:*) echo \"bad task path syntax; use //$1 or a :task\" >&2; exit 1;;\nesac\nmise \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on //pkg:task for cross-package invocations in docs and scripts.","Remember: relative 'pkg:task' paths are never valid; only '//' absolute and ':' current-dir."],"tags":["monorepo","task-syntax","path-resolution","mise"],"backgroundTag":"invalid-task-path-syntax","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}