{"record":{"id":"487504910cd2994b","repo":"jdx/mise","slug":"key-cannot-contain-empty-values","errorCode":null,"errorMessage":"{key} cannot contain empty values","messagePattern":"(.+?) cannot contain empty values","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/backend/pipx.rs","lineNumber":93,"sourceCode":"                    serde_json::from_str(value)\n                        .map_err(|_| eyre!(\"{key} must be a string or array of strings\"))?\n                } else {\n                    vec![value.clone()]\n                }\n            }\n            toml::Value::Array(values) => values\n                .iter()\n                .map(|value| {\n                    value\n                        .as_str()\n                        .map(str::to_owned)\n                        .ok_or_else(|| eyre!(\"{key} must be a string or array of strings\"))\n                })\n                .collect::<Result<Vec<_>>>()?,\n            _ => bail!(\"{key} must be a string or array of strings\"),\n        };\n        if values.iter().any(|value| value.trim().is_empty()) {\n            bail!(\"{key} cannot contain empty values\");\n        }\n        Ok(values)\n    }\n\n    fn with(&self) -> Result<Vec<String>> {\n        self.string_list(\"with\")\n    }\n\n    fn expose(&self) -> Result<Vec<String>> {\n        self.string_list(\"expose\")\n    }\n\n    fn exposed_package_names(&self) -> Result<Vec<String>> {\n        self.expose()?\n            .into_iter()\n            .map(|requirement| {\n                let Some(name) = Self::requirement_package_name(&requirement) else {\n                    bail!(\"expose must contain named Python package requirements\");","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/backend/pipx.rs#L75-L111","documentation":"The same string_list helper validates that after parsing, none of the collected values is empty or whitespace-only. An empty entry would produce a meaningless pipx flag (e.g. `--with ''`), so mise rejects the option list.","triggerScenarios":"Options like `with = [\"\", \"black\"]` or `expose = [\" \"]` — a string in the array that is empty or only whitespace.","commonSituations":"Trailing commas or blank entries in hand-edited TOML arrays; templating/variable expansion that produced an empty string; programmatic config generation emitting empty items.","solutions":["Remove the empty/whitespace entries from the array","Quote and fill in values where a placeholder was left blank: `with = [\"pytest\"]`","If a value comes from a variable, guard against it expanding to empty"],"exampleFix":"# before\n[tools]\nfoo = { source = \"pipx\", with = [\"\", \"black\"] }\n# after\n[tools]\nfoo = { source = \"pipx\", with = [\"black\"] }","handlingStrategy":"validation","validationCode":"// Reject empty/whitespace entries before passing options\nconst clean = (xs: string[]) => xs.filter(x => x.trim().length > 0);","typeGuard":"const hasNoEmpty = (xs: string[]) => xs.every(x => x.trim() !== '');","tryCatchPattern":null,"preventionTips":["Trim/filter option lists generated programmatically before writing config","Check hand-edited arrays for blank entries left by trailing commas","Regenerate config from templates and inspect the expansion"],"tags":["pipx","config","validation","empty-value"],"backgroundTag":"empty-required-field","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"}