jdx/mise · error

unknown idiomatic file field: {key}

Error message

unknown idiomatic file field: {key}

What it means

When a registry tool's idiomatic-file configuration is given as a TOML table, mise only accepts a fixed set of keys: path, version_regex, version_json_path, version_expr, and related known fields. Any other key in that table is rejected with this error naming the offending key. This strictness catches typos that would otherwise silently disable idiomatic version detection.

Source

Thrown at src/registry.rs:499

                .map(parse_registry_idiomatic_file)
                .collect()
        })
        .transpose()
        .map(Option::unwrap_or_default)
}

fn parse_registry_idiomatic_file(value: &toml::Value) -> Result<RegistryIdiomaticFile> {
    match value {
        toml::Value::String(path) => Ok(RegistryIdiomaticFile {
            path: leak_string(path.clone()),
            version_regex: None,
            version_json_path: None,
            version_expr: None,
            deprecated: None,
        }),
        toml::Value::Table(table) => {
            for key in table.keys() {
                ensure!(
                    matches!(
                        key.as_str(),
                        "path"
                            | "version_regex"
                            | "version_json_path"
                            | "version_expr"
                            | "deprecated"
                    ),
                    "unknown idiomatic file field: {key}"
                );
            }
            let string = |key: &str| -> Result<Option<&'static str>> {
                table
                    .get(key)
                    .map(|value| {
                        value
                            .as_str()
                            .map(|value| leak_string(value.to_string()))

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Replace the unknown key with the correct supported field name (check the registry schema: path, version_regex, version_json_path, version_expr, deprecated).
  2. Common fixes: `regex` -> `version_regex`, `file`/`file_path` -> `path`, `json_path` -> `version_json_path`, `expr` -> `version_expr`.
  3. Validate the tool TOML against the schema before submitting; remove fields the current mise version does not support.

Example fix

// before
[[tools.node.idiomatic_files]]
file = ".nvmrc"
regex = "v(\d+\.\d+\.\d+)"

// after
[[tools.node.idiomatic_files]]
path = ".nvmrc"
version_regex = "v(\d+\.\d+\.\d+)"
Defensive patterns

Strategy: validation

Validate before calling

// allow-list idiomatic-file keys before parsing
const ALLOWED: [&str; 5] = ["path", "version_regex", "version_json_path", "version_expr", "deprecated"];
for key in table.keys() {
    assert!(ALLOWED.contains(&key.as_str()), "unknown idiomatic file field: {key}");
}

Prevention

When it happens

Trigger: parse_registry_idiomatic_file encountering a TOML table for idiomatic_files (per-tool version-from-file config) containing an unknown key such as `regex` (instead of `version_regex`) or `file` (instead of `path`).

Common situations: Registry contributors misspell a field name, invent a field not yet supported by the schema, or copy a key from a different config section (e.g. backend fields) into the idiomatic-file table.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/4fee15eed66cc7a7. Report an issue: GitHub.