jdx/mise · error

brew-cask: : unsupported step type

Error message

brew-cask:{}: unsupported {kind} step type {}

What it means

Flight steps (pre/post/uninstall step arrays) support a fixed set of step types (e.g. run, delete, copy, symlink, terminate_process). When the `type` field of a step doesn't correspond to any supported step type, parsing bails with the unrecognized `type` value and the cask token.

Solutions

  1. Check the supported step types in src/system/packages/brew/cask/artifacts.rs and change `type` to one of them (e.g. "run", "delete", "copy", "symlink", "terminate_process").
  2. Remove the step if the operation isn't supported, or approximate it with a `run` step.
  3. If the step type should exist, file an issue to add it to the cask flight-step parser.

Example fix

// before
[[flight.steps]]
type = "launchctl"
... 
// after
[[flight.steps]]
type = "run"
command = "launchctl remove com.example.myapp"
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = new Set(["run", "delete", "copy", "symlink", "terminate_process"]);
for (const step of flightSteps)
  if (!SUPPORTED.has(step.type))
    throw new Error(`unsupported step type: ${step.type}`);

Type guard

function isSupportedStepType(t, supported) {
  return typeof t === "string" && supported.includes(t);
}

Try / catch

try {
  parseCaskArtifacts(cask);
} catch (err) {
  if (err.message.includes("unsupported" ) && err.message.includes("step type")) {
    // map the step to a supported type or drop it
  } else throw err;
}

Prevention

When it happens

Trigger: A flight step entry whose `type` string is unknown to `parse_flight_step`, e.g. `type = "launchctl"`, `type = "script"`, or a typo like `type = "runn"`.

Common situations: Copying Homebrew Ruby cask stanza names (e.g. `zap`, `quarantine`) that the mise simplified flight schema doesn't implement, or typos in the type string.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

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

            let failure_message = match object.get("failure_message") {
                None | Some(Value::Null) => None,
                Some(Value::String(value)) => Some(value.clone()),
                Some(_) => bail!(
                    "brew-cask:{}: {kind} terminate_process failure_message must be a string",
                    cask.token
                ),
            };
            Ok(FlightStep::TerminateProcess {
                name: name.to_string(),
                match_mode,
                sudo,
                attempts,
                must_succeed,
                notices,
                failure_message,
            })
        }
        _ => bail!(
            "brew-cask:{}: unsupported {kind} step type {}",
            cask.token,
            step_type
        ),
    }
}

pub(super) fn parse_flight_sudo(
    cask: &Cask,
    kind: &str,
    value: Option<&Value>,
) -> Result<FlightSudo> {
    match value {
        None | Some(Value::Bool(false)) => Ok(FlightSudo::Never),
        Some(Value::Bool(true)) => Ok(FlightSudo::Always),
        Some(Value::String(value)) if value == "if_needed" => Ok(FlightSudo::IfNeeded),
        _ => bail!("brew-cask:{}: unsupported {kind} sudo setting", cask.token),
    }

View on GitHub (pinned to 533346cc37)