jdx/mise · error

[bootstrap.macos.dock].apps: expected an array of…

Error message

[bootstrap.macos.dock].apps: expected an array of application paths

What it means

Validation error in `dock::paths`: the value configured under `bootstrap.macos.dock` key `apps` is not a `DefaultsValue::Array`. The library expects an array of application path strings to reconcile against the Dock's `persistent-apps`, and refuses to proceed otherwise.

Solutions

  1. Change the config so `bootstrap.macos.dock.apps` is an array of strings: `apps = ["/Applications/Safari.app"]`.
  2. Check for templating/interpolation that turns the list into a single joined string and fix the expression.
  3. Ensure you are reading the correct key (`apps`) and not a sibling scalar value when constructing the DefaultsRequest.

Example fix

// before
[bootstrap.macos.dock]
apps = "/Applications/Safari.app"
// after
[bootstrap.macos.dock]
apps = ["/Applications/Safari.app"]
Defensive patterns

Strategy: validation

Validate before calling

let apps = &config["bootstrap"]["macos"]["dock"]["apps"];
assert!(apps.is_array(), "bootstrap.macos.dock.apps must be an array of path strings");

Type guard

fn is_app_paths(v: &serde_json::Value) -> bool {
    v.is_array() && v.as_array().map_or(false, |a| a.iter().all(|i| i.is_string()))
}

Prevention

When it happens

Trigger: Calling `paths` (via `matches` or `reconcile`) with a `DefaultsValue` that is a Str, Bool, Integer, Table, etc. — i.e. the TOML/config set `apps` to a single string or another non-array type instead of an array of paths.

Common situations: Writing `apps = "/Applications/Safari.app"` (bare string) instead of `apps = ["/Applications/Safari.app"]` in the config; quoting or templating mistakes collapsing an array into a string; passing the wrong key's value into the dock reconciler.

Related errors


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

Appendix: source

Thrown at src/system/defaults/dock.rs:9

//! Application layout semantics for the friendly Dock setting. Raw defaults remain exact.
use std::path::{Component, Path, PathBuf};

use super::DefaultsValue;
use crate::result::Result;

pub(super) fn paths(value: &DefaultsValue) -> Result<Vec<PathBuf>> {
    let DefaultsValue::Array(values) = value else {
        eyre::bail!("[bootstrap.macos.dock].apps: expected an array of application paths");
    };
    let mut paths = Vec::new();
    let mut seen = std::collections::HashSet::new();
    for value in values {
        let DefaultsValue::Str(value) = value else {
            eyre::bail!("[bootstrap.macos.dock].apps: expected an array of application paths");
        };
        let path = if let Some(rest) = value.strip_prefix("~/") {
            eyre::ensure!(
                !Path::new(rest).has_root(),
                "[bootstrap.macos.dock].apps: expected a path relative to home: {value}"
            );
            crate::env::HOME.join(rest)
        } else {
            PathBuf::from(value)
        };
        eyre::ensure!(
            path.is_absolute()

View on GitHub (pinned to 533346cc37)