{"record":{"id":"084094f3aabb3626","repo":"jdx/mise","slug":"dependency-prereleases-must-be-disallow-allow-if-necessary","errorCode":null,"errorMessage":"dependency_prereleases must be disallow, allow, if-necessary, or explicit","messagePattern":"dependency_prereleases must be disallow, allow, if-necessary, or explicit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/pipx.rs","lineNumber":136,"sourceCode":"    fn requirement_package_name(requirement: &str) -> Option<&str> {\n        let name = requirement\n            .trim()\n            .split(|c: char| !(c.is_ascii_alphanumeric() || matches!(c, '-' | '_' | '.')))\n            .next()\n            .unwrap_or_default();\n        (!name.is_empty()).then_some(name)\n    }\n\n    fn dependency_prereleases(&self) -> Result<Option<&'a str>> {\n        let value = match self.values.raw().opts.get(\"dependency_prereleases\") {\n            Some(toml::Value::String(value)) => Some(value.as_str()),\n            Some(_) => bail!(\"dependency_prereleases must be a string\"),\n            None => None,\n        };\n        if value.is_some_and(|value| {\n            !matches!(value, \"disallow\" | \"allow\" | \"if-necessary\" | \"explicit\")\n        }) {\n            bail!(\"dependency_prereleases must be disallow, allow, if-necessary, or explicit\");\n        }\n        Ok(value)\n    }\n\n    fn has_uv_only_options(&self) -> Result<bool> {\n        Ok(!self.with()?.is_empty()\n            || !self.expose()?.is_empty()\n            || self.dependency_prereleases()?.is_some())\n    }\n\n    fn validate_semantic(&self) -> Result<()> {\n        self.with()?;\n        self.exposed_package_names()?;\n        self.dependency_prereleases()?;\n        if self.has_uv_only_options()? && self.uvx_disabled() {\n            bail!(\"with, expose, and dependency_prereleases cannot be combined with uvx = false\");\n        }\n        Ok(())","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/pipx.rs#L118-L154","documentation":"The mise pipx backend's dependency_prereleases option only accepts four exact string values: \"disallow\", \"allow\", \"if-necessary\", or \"explicit\". This value is forwarded to uv's prerelease resolution strategy when building dependency-locked installs, so an unrecognized string is rejected at validation time rather than silently mis-resolving. The backend bails to surface the typo immediately.","triggerScenarios":"Setting dependency_prereleases in pipx tool options (e.g. mise.toml [tools].\"pipx:ruff\" options) to any string outside the four allowed values, such as \"if_necessary\" (underscore), \"always\", \"true\", or \"Dis-Allow\". The check runs in the option parser called by has_uv_only_options, validate_semantic, and uv_install_args.","commonSituations":"Typos or wrong casing when writing the option by hand; using Python-style booleans like \"true\"/\"false\"; copying uv CLI flag names (--prerelease=if-necessary-or-explicit) that don't match the option's enumerated set; config from an older/newer version with different allowed values.","solutions":["Change dependency_prereleases to exactly one of: disallow, allow, if-necessary, or explicit","If you meant the uv CLI value \"if-necessary-or-explicit\", use \"explicit\" or \"if-necessary\" instead","Remove the dependency_prereleases option if you don't need prerelease control"],"exampleFix":"// before (mise.toml)\n[tools]\n\"pipx:ruff\" = { version = \"latest\", dependency_prereleases = \"if_necessary\" }\n// after\n[tools]\n\"pipx:ruff\" = { version = \"latest\", dependency_prereleases = \"if-necessary\" }","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set([\"disallow\", \"allow\", \"if-necessary\", \"explicit\"]);\nif (opts.dependency_prereleases && !ALLOWED.has(opts.dependency_prereleases))\n  throw new Error(`dependency_prereleases must be one of: ${[...ALLOWED].join(\", \")}`);","typeGuard":"function isPrereleaseMode(v: unknown): v is \"disallow\" | \"allow\" | \"if-necessary\" | \"explicit\" {\n  return v === \"disallow\" || v === \"allow\" || v === \"if-necessary\" || v === \"explicit\";\n}","tryCatchPattern":null,"preventionTips":["Copy allowed values verbatim from the docs; use hyphens (if-necessary), not underscores","Schema-validate mise.toml tool options (mise has a JSON schema) before committing"],"tags":["config-validation","pipx","uv","prerelease-resolution"],"backgroundTag":"invalid-enum-value","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"}