jdx/mise · error

brew-cask: unsupported

Error message

brew-cask: unsupported {context} field {}

What it means

When parsing a brew cask artifact stanza, mise validates that every TOML/JSON key inside the artifact object is one of the fields allowed for that artifact type (context names which artifact, e.g. 'installer' or 'generate_completions_from_executable'). If any unknown key is present, parsing bails with this error listing the offending keys. It exists so cask artifact definitions stay faithful to Homebrew's schema instead of silently ignoring typos or unsupported options.

Solutions

  1. Remove the unsupported key(s) named in the message from the artifact object.
  2. Check the allowed field list for the artifact type in src/system/packages/brew/cask/artifacts.rs and rename the key to a supported one.
  3. If the field is genuinely needed, the artifact type doesn't model it yet — use a different artifact stanza or file an issue to add support.

Example fix

// before
[[artifacts.installer]]
script = "install.sh"
arguements = ["--user"]
// after
[[artifacts.installer]]
script = "install.sh"
args = ["--user"]
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED_INSTALLER = new Set(["script", "args"]);
const ALLOWED_COMPLETIONS = new Set(["executable", "args", "shells", "base_name"]);
function checkArtifactFields(artifact, allowed) {
  const bad = Object.keys(artifact).filter((k) => !allowed.has(k));
  if (bad.length) throw new Error(`brew-cask: unsupported field(s): ${bad.join(", ")}`);
}

Type guard

function hasOnlyAllowedKeys(obj, allowed) {
  return obj != null && typeof obj === "object" &&
    Object.keys(obj).every((k) => allowed.includes(k));
}

Try / catch

try {
  parseCaskArtifacts(cask);
} catch (err) {
  if (/unsupported .* field/.test(err.message)) {
    // strip or rename the listed keys before retrying
  } else throw err;
}

Prevention

When it happens

Trigger: A cask artifact object contains a key not in the artifact's allowed set — e.g. an `[[bin]]`/installer-style entry with `args`, `base_name`, or any misspelled field passed through `reject_unsupported_artifact_fields` from `parse_installer_artifact` or `parse_generated_completion_artifact`.

Common situations: Typoed field names in a mise-managed cask definition (e.g. `arg` instead of `args`), copying Homebrew Ruby cask stanza fields that the simplified mise schema doesn't support, or adding options to an artifact type that only supports a subset.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/0c2d6f1cf15f162a. Report an issue: GitHub.

Appendix: source

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

            arg.as_str()
                .map(str::to_string)
                .ok_or_else(|| eyre!("brew-cask: {kind} args must be strings"))
        })
        .collect()
}

pub(super) fn reject_unsupported_artifact_fields(
    context: &str,
    object: &serde_json::Map<String, Value>,
    allowed: &[&str],
) -> Result<()> {
    let unsupported = object
        .keys()
        .filter(|key| !allowed.contains(&key.as_str()))
        .cloned()
        .collect::<Vec<_>>();
    if !unsupported.is_empty() {
        bail!(
            "brew-cask: unsupported {context} field {}",
            unsupported.join(", ")
        );
    }
    Ok(())
}

pub(super) fn parse_generic_artifact(value: &Value) -> Result<Option<GenericArtifact>> {
    let Some(artifact) = value.as_object().and_then(|object| object.get("artifact")) else {
        return Ok(None);
    };
    let values = artifact
        .as_array()
        .ok_or_else(|| eyre!("brew-cask: artifact metadata must be an array"))?;
    let source = values
        .first()
        .and_then(Value::as_str)
        .ok_or_else(|| eyre!("brew-cask: artifact requires a source"))?;

View on GitHub (pinned to 533346cc37)