jdx/mise · error

Type not found

Error message

Type not found

What it means

`mise config set --type` accepts an explicit TOML value type (string, array, etc.). When the requested type cannot be mapped to a known TomlValueTypes variant (i.e. it falls through to the `TomlValueTypes::Infer` arm in the match), mise cannot decide how to serialize the value and bails with 'Type not found'. This is a user-input error on the --type flag, not an internal failure.

Source

Thrown at src/cli/config/set.rs:222

            TomlValueTypes::Bool => toml_edit::value(value.parse::<bool>()?),
            TomlValueTypes::List => {
                let mut list = toml_edit::Array::new();
                for item in value.split(',').map(|s| s.trim()) {
                    list.push(item);
                }
                toml_edit::Item::Value(toml_edit::Value::Array(list))
            }
            TomlValueTypes::Set => {
                let mut set = toml_edit::Array::new();
                let value = value.trim();
                if value != "[]" {
                    for item in value.split(',').map(|s| s.trim()).filter(|s| !s.is_empty()) {
                        set.push(item);
                    }
                }
                toml_edit::Item::Value(toml_edit::Value::Array(dedup_toml_array(&set)))
            }
            TomlValueTypes::Infer => bail!("Type not found"),
        };

        let table = container.as_table_like_mut().ok_or_else(|| {
            eyre::eyre!(
                "cannot set '{full_key}': '{}' is already set to a non-table value",
                parts[..parts.len() - 1].join(".")
            )
        })?;
        if self.append {
            append_value(table, last_key, value)?;
        } else if self.remove {
            remove_value(table, last_key, &value)?;
        } else {
            table.insert(last_key, value);
        }

        let raw = config.to_string();
        MiseToml::from_str(&raw, &file)?;

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Check `mise config set --help` for the exact list of accepted --type values and use one verbatim
  2. Correct the spelling of the --type value (e.g. `str` -> `string`)
  3. If the value is a comma-separated list, use the array type so it is split and stored as a TOML array

Example fix

// before
mise config set env.NODE_VERSION str 20
// after
mise config set env.NODE_VERSION string 20
Defensive patterns

Strategy: validation

Validate before calling

TYPE=$(...); case "$TYPE" in string|integer|float|bool|bools|array|infer) ;; *) echo "invalid --type '$TYPE'"; exit 1;; esac

Prevention

When it happens

Trigger: Running `mise config set` with a --type value that does not match any supported TomlValueTypes variant (the match on the parsed type reaches the `Infer =>` arm).

Common situations: Typos in the --type flag (e.g. `--type str` instead of `--type string`), copy-pasting a type name from other tools (YAML/JSON schema names), or omitting --type in a context where inference is not allowed by this code path.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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