jdx/mise · error
aqua var `{}` must be a string, got {}
Error message
aqua var `{}` must be a string, got {} What it means
Aqua packages can define template variables (`vars`) used in registry expressions. toml_string_var enforces that each aqua var used by the embedded plugin is a TOML string. If a var is defined with a non-string TOML type (integer, boolean, table, array), mise returns this error because the templating layer expects string values.
Source
Thrown at src/backend/aqua.rs:3440
/// A failed verification may become valid after resolving a repository transfer.
/// Only a verified attestation can skip the canonical-repository lookup.
fn attestation_needs_transfer_retry(
result: &std::result::Result<bool, crate::github::sigstore::AttestationError>,
) -> bool {
!matches!(result, Ok(true))
}
fn toml_value_to_string(value: &toml::Value) -> Option<String> {
match value {
toml::Value::String(s) => Some(s.clone()),
_ => None,
}
}
fn toml_string_var(key: &str, value: &toml::Value) -> Result<String> {
match value {
toml::Value::String(s) => Ok(s.clone()),
value => bail!(
"aqua var `{}` must be a string, got {}",
key,
toml_value_kind(value)
),
}
}
fn toml_value_kind(value: &toml::Value) -> &'static str {
match value {
toml::Value::String(_) => "string",
toml::Value::Integer(_) | toml::Value::Float(_) => "number",
toml::Value::Boolean(_) => "boolean",
toml::Value::Array(_) => "array",
toml::Value::Table(_) => "object",
toml::Value::Datetime(_) => "datetime",
}
}
View on GitHub (pinned to afd2eddd3a)
Solutions
- Quote the var value in the TOML config so it is a string: `vars.version = "3"`
- Check which aqua var key is named in the message and inspect its declared type
- Update mise if a recent registry change introduced the non-string var
- If authoring embedded plugin options in build.rs input, wrap all values as strings before serialization
Example fix
# before (mise.toml / embedded plugin options) [tools.aqua-vars] version = 3 # after [tools.aqua-vars] version = "3"
Defensive patterns
Strategy: validation
Validate before calling
// ensure every aqua var you configure is a string
function assertStringVars(vars) {
for (const [k, v] of Object.entries(vars ?? {})) {
if (typeof v !== "string") throw new Error(`aqua var '${k}' must be a string, got ${typeof v}`);
}
}
assertStringVars(config["aqua-vars"]); Type guard
function isTomlStringVar(v) {
return typeof v === "string";
} Try / catch
try {
await $`mise install`;
} catch (e) {
const m = String(e).match(/aqua var `(\S+)` must be a string/);
if (m) {
// quote the offending var in mise.toml and retry
console.error(`Fix mise.toml: quote the value of '${m[1]}'`);
} else throw e;
} Prevention
- Always quote aqua var values in TOML so numbers/booleans stay strings
- Run `mise fmt` / schema validation on mise.toml before committing
- Avoid bare `= 1` or `= true` in aqua-related vars sections
When it happens
Trigger: Loading/generating an embedded aqua plugin (aqua.rs:3440, reached via build.rs codegen path) where a package's or registry's var entry in the TOML configuration is declared as a non-string value, e.g. `vars.version = 3` or `vars.enabled = true`.
Common situations: Hand-editing an aqua-related config and writing an unquoted number or boolean; a registry migration changed a var's type; TOML auto-typing turns `version = 1.0` into a float.
Related errors
- [history] in {} is not a table
- [history] exclude in {} is not an array
- backend must be a string or table
- expected `run` to be a string or array of strings
- {message}
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/a8fe9d5f60226e71.
Report an issue: GitHub.