{"record":{"id":"eb29837e791e31f6","repo":"jdx/mise","slug":"dependency-prereleases-must-be-a-string","errorCode":null,"errorMessage":"dependency_prereleases must be a string","messagePattern":"dependency_prereleases must be a string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/pipx.rs","lineNumber":130,"sourceCode":"                };\n                Ok(name.to_string())\n            })\n            .collect()\n    }\n\n    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()?;","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/pipx.rs#L112-L148","documentation":"The pipx backend's dependency_prereleases option controls whether dependencies may resolve to pre-release versions. It must be the string \"disallow\", \"allow\", \"if-necessary\", or \"explicit\". A non-string TOML value first raises this type error; a string outside the allowed set raises the related enum error.","triggerScenarios":"A tool config like `foo = { source = \"pipx\", dependency_prereleases = true }` (boolean instead of string) is read by dependency_prereleases via validate_semantic / has_uv_only_options / uv_install_args.","commonSituations":"Writing the option as a boolean or number because other tools accept bare flags; copying a flag-style option from uv docs; typo mixing option styles in mise.toml.","solutions":["Use a quoted string value: `dependency_prereleases = \"allow\"`","Pick one of the four valid values: \"disallow\", \"allow\", \"if-necessary\", \"explicit\"","Remove the option if you only want default (disallow) behavior"],"exampleFix":"# before\n[tools]\nfoo = { source = \"pipx\", dependency_prereleases = true }\n# after\n[tools]\nfoo = { source = \"pipx\", dependency_prereleases = \"allow\" }","handlingStrategy":"validation","validationCode":"// Validate dependency_prereleases before writing config\nconst valid = ['disallow','allow','if-necessary','explicit'];\nconst ok = (v: unknown) => typeof v === 'string' && valid.includes(v);","typeGuard":"const isPrereleaseMode = (v: unknown): v is 'disallow'|'allow'|'if-necessary'|'explicit' =>\n  typeof v === 'string' && ['disallow','allow','if-necessary','explicit'].includes(v);","tryCatchPattern":null,"preventionTips":["Quote enum-like config values in mise.toml","Check mise docs for the option's expected type before setting it","Use the mise JSON schema in your editor for live config validation"],"tags":["pipx","config","type-error","enum"],"backgroundTag":"config-type-mismatch","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"}