jdx/mise · error

brew-cask:{}: unsupported {kind} {field} base

Error message

brew-cask:{}: unsupported {kind} {field} base

What it means

For move/rename-style cask path fields, `base` is required: unlike contextual guard paths there is no literal/relative default. This error fires when the path object omits `base` (or it isn't a string).

Source

Thrown at src/system/packages/brew/cask/artifacts.rs:1076

    cask: &Cask,
    kind: &str,
    field: &str,
    value: Option<&Value>,
) -> Result<FlightPath> {
    let object = value.and_then(Value::as_object).ok_or_else(|| {
        eyre!(
            "brew-cask:{}: unsupported {kind} {field} metadata format",
            cask.token
        )
    })?;
    let base = match object.get("base").and_then(Value::as_str) {
        Some("staged_path") => FlightPathBase::StagedPath,
        Some(base) => bail!(
            "brew-cask:{}: unsupported {kind} {field} base {}",
            cask.token,
            base
        ),
        None => bail!("brew-cask:{}: unsupported {kind} {field} base", cask.token),
    };
    let path = object
        .get("path")
        .and_then(Value::as_str)
        .ok_or_else(|| eyre!("brew-cask:{}: unsupported {kind} {field} path", cask.token))?;
    if validate_flight_relative_path(path).is_err() {
        bail!(
            "brew-cask:{}: invalid {kind} {field} path {}",
            cask.token,
            path
        )
    }
    Ok(FlightPath {
        base,
        path: path.to_string(),
    })
}

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Add "base": "staged_path" to the path object.
  2. Ensure `base` is a JSON string, not a nested object or null.
  3. Compare with a working Homebrew cask `move` stanza and mirror its structure.
  4. Validate the stanza JSON before install to catch the missing key early.

Example fix

// before
{ "path": "Foo.app" }
// after
{ "base": "staged_path", "path": "Foo.app" }
Defensive patterns

Strategy: validation

Validate before calling

function movePathHasBase(p) {
  return typeof p === "object" && p !== null && typeof p.base === "string" && p.base.length > 0;
}

Try / catch

try {
  installCask(token);
} catch (e) {
  if (String(e).includes("base") && String(e).endsWith(`base"`) === false && String(e).includes("base\",")) {
    // missing-value variant
    console.warn(`Cask ${token} move path is missing its base`);
  } else throw e;
}

Prevention

When it happens

Trigger: A cask move artifact path object like {"path":"Foo.app"} with no `base` key, or `base` set to a non-string value.

Common situations: Hand-written cask stanzas omitting the mandatory base, converted casks from tooling that strips base, and authors assuming path is relative by default as in guard paths.

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/f3d64e81834bd847. Report an issue: GitHub.