jdx/mise · error
invalid {name} value {invalid:?}; expected one of: {}
Error message
invalid {name} value {invalid:?}; expected one of: {} What it means
This error is thrown when a mise settings value is not one of the allowed enum values for that setting. `validate_setting_enum_values` iterates the provided values and bails with the setting name, the offending value, and the list of allowed values. It is the generic validator used wherever a setting is restricted to a fixed set of strings.
Source
Thrown at src/config/settings.rs:1969
let trimmed = s.trim();
if !trimmed.is_empty() {
Some(T::from_str(trimmed))
} else {
None
}
})
// collect into BTreeSet to remove duplicates
.collect::<Result<BTreeSet<_>, _>>()
.map(|set| set.into_iter().collect())
}
fn validate_setting_enum_values<'a>(
name: &str,
values: impl IntoIterator<Item = &'a str>,
allowed: &[&str],
) -> Result<()> {
if let Some(invalid) = values.into_iter().find(|value| !allowed.contains(value)) {
bail!(
"invalid {name} value {invalid:?}; expected one of: {}",
allowed.join(", ")
);
}
Ok(())
}
fn normalize_tool_names(tools: &BTreeSet<String>) -> BTreeSet<String> {
tools
.iter()
.map(|t| t.trim())
.filter(|t| !t.is_empty())
.map(str::to_string)
.collect()
}
fn split_default_shell_or_fallback(sa: &str, fallback: &str) -> Result<Vec<String>> {
let shell = crate::path::split_shell_command(sa)?;View on GitHub (pinned to afd2eddd3a)
Solutions
- Read the 'expected one of: ...' list in the message and set the value to exactly one of those strings
- Run `mise settings` (or check docs/settings.toml) to see valid values for the key
- Check for typos and case sensitivity in the value
- Verify the setting exists in your mise version; the allowed set may differ across releases
Example fix
// before (mise.toml) [settings] node_compile = "yes" // after [settings] node_compile = "true"
Defensive patterns
Strategy: validation
Validate before calling
const ALLOWED = ["true", "false", "auto"]; // per setting
if (!ALLOWED.includes(value)) throw new Error(`invalid ${key} value ${value}; expected one of: ${ALLOWED.join(", ")}`); Prevention
- Copy allowed values from `mise settings` output instead of typing them
- Pin mise version in CI so the allowed value set is stable
- Validate settings files in review/CI with `mise settings get <key>`
When it happens
Trigger: Setting a settings key (e.g. via `mise settings set <key> <value>`, mise.toml `[settings]`, or MISE_<KEY> env vars) to a string that is not in the setting's allowed list; the invalid value is rejected at settings validation time.
Common situations: Typos in a settings value ('true' vs 'tru', wrong casing), copying a value valid for one setting into another, upgrading/downgrading mise where the allowed set changed, or writing an env-var-based setting with a wrong literal.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- unknown history.sync mode {other:?}; use sync, fetch-only, o
- managed path '{}' notifies unconfigured bootstrap service '{
- managed path '{}' notifies unconfigured bootstrap service '{
- cask uses `#{feature}`, which mise's cask shim does not supp
- formula uses `#{feature}`, which mise's source-build shim do
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/886dd353d0360012.
Report an issue: GitHub.