jdx/mise · error
brew-cask: unsupported {context} field {}
Error message
brew-cask: unsupported {context} field {} What it means
Thrown by reject_unsupported_artifact_fields, a strict allow-list check shared by artifact parsers. Every key in the artifact's JSON object must appear in that artifact type's allowed list; any leftover keys are collected and reported (comma-joined) in the message. This is deliberate fail-fast behavior so new or unrecognized Homebrew artifact fields do not get silently dropped.
Source
Thrown at src/system/packages/brew/cask.rs:5282
.unwrap_or_default();
Ok(Some(InstallerArtifact {
executable: executable.to_string(),
args,
}))
}
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(())
}
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 6f52dcdf99)
Solutions
- Remove the offending key named in the error message from the artifact object
- Check the allowed list for that artifact type in src/system/packages/brew/cask.rs to see which spellings are accepted
- Update mise — if the field is now supported the newer allow-list will accept it; otherwise report the cask token upstream
Example fix
// before
{"binary": ["tool"], "only_if": {"condition": "on", "value": "macos"}}
// after
{"binary": ["tool"]} Defensive patterns
Strategy: validation
Validate before calling
fn artifact_fields_allowed(v: &serde_json::Value, allowed: &[&str]) -> bool {
v.as_object().map(|o| o.keys().all(|k| allowed.contains(&k.as_str()))).unwrap_or(true)
} Try / catch
match cask_artifacts(&cask) {
Ok(a) => { /* proceed */ }
Err(e) if e.to_string().starts_with("brew-cask: unsupported") && e.to_string().contains("field") => {
eprintln!("cask {} uses an artifact field mise does not support: {e}", cask.token);
}
Err(e) => return Err(e),
} Prevention
- Keep artifact objects minimal — only the documented keys for that artifact type
- When Homebrew metadata changes, upgrade mise before retrying the cask
- Validate custom cask JSON against the allowed lists in src/system/packages/brew/cask.rs
When it happens
Trigger: Any artifact object containing a key outside its allow-list, e.g. a binary artifact carrying an extra "only_if" key or an app artifact with "when" — the message names the context and the offending key(s), e.g. 'brew-cask: unsupported binary artifact field only_if'.
Common situations: Homebrew adds a new artifact sub-field and an older mise rejects it; hand-crafted cask JSON with typos or fields copied from a different artifact type; conversion scripts that pass through unknown keys.
Related errors
- brew-cask:{}: unsupported {kind} {context} field {}
- brew-cask: command_wrapper '{}' must set exactly one of cont
- brew-cask: command_wrapper args and env require executable
- brew-cask: pkg installer choices are not supported yet
- brew-cask: generate_completions_from_executable requires an
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/5fa1372a1da2295d.
Report an issue: GitHub.