{"record":{"id":"4847e6e57a01cffb","repo":"jdx/mise","slug":"invalid-prefix","errorCode":null,"errorMessage":"invalid prefix: {}","messagePattern":"invalid prefix: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/args/tool_arg.rs","lineNumber":75,"sourceCode":"    }\n}\n\nimpl FromStr for ToolVersionType {\n    type Err = eyre::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        trace!(\"parsing ToolVersionType from: {}\", s);\n        Ok(match s.split_once(':') {\n            Some((ref_type @ (\"ref\" | \"tag\" | \"branch\" | \"rev\"), r)) => {\n                Self::Ref(ref_type.to_string(), r.to_string())\n            }\n            Some((\"prefix\", p)) => Self::Prefix(p.to_string()),\n            Some((\"path\", p)) => Self::Path(PathBuf::from(p)),\n            Some((p, v)) if p.starts_with(\"sub-\") => Self::Sub {\n                sub: p.split_once('-').unwrap().1.to_string(),\n                orig_version: v.to_string(),\n            },\n            Some((p, _)) => bail!(\"invalid prefix: {}\", style::ered(p)),\n            None if s == \"system\" => Self::System,\n            None => Self::Version(s.to_string()),\n        })\n    }\n}\n\nimpl Display for ToolVersionType {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        match self {\n            Self::Path(p) => write!(f, \"path:{}\", p.to_string_lossy()),\n            Self::Prefix(p) => write!(f, \"prefix:{p}\"),\n            Self::Ref(rt, r) => write!(f, \"{rt}:{r}\"),\n            Self::Sub { sub, orig_version } => write!(f, \"sub-{sub}:{orig_version}\"),\n            Self::System => write!(f, \"system\"),\n            Self::Version(v) => write!(f, \"{v}\"),\n        }\n    }\n}","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/args/tool_arg.rs#L57-L93","documentation":"ToolVersionType::from_str saw a `prefix:` version qualifier whose remainder p is rejected by the follow-on validation (the shown guard fires for a prefix segment that does not meet the parser's requirements). It means the tool request string like `tool@prefix:...` is malformed at the prefix value.","triggerScenarios":"Writing a version string like `foo:1.2` or `xyz-1.2` in mise.toml / .tool-versions where the leading segment is not a supported prefix.","commonSituations":"Typos in sub-<name> syntax (missing 'sub-' or wrong separator); copy-pasting version specs from other tools (e.g. 'ref:main' style not supported here).","solutions":["Use a supported prefix: `prefix:<v>`, `path:<p>`, or `sub-<name>:<v>`.","Remove the unknown prefix and use a plain version string.","If a ref/channel is intended, use the backend's supported syntax (e.g. `latest`, or backend-specific channel names)."],"exampleFix":"// before\n[tools]\nnode = \"min-22\"\n// after\n[tools]\nnode = \"prefix:22\"","handlingStrategy":"validation","validationCode":"[[ \"$ver\" =~ ^(prefix:|path:|sub-[a-zA-Z0-9_-]+:)?[^:]+$ ]] || echo \"unsupported prefix in $ver\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Memorize the supported prefixes: prefix:, path:, sub-<name>.","Avoid colon syntax copied from other tools.","Validate mise.toml against the schema (mise run render:schema / jsonschema)."],"tags":["cli","version-parsing"],"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"}