jdx/mise · error

path " " must be absolute or start with ~/, ignoring entry

Error message

path "{path_raw}" must be absolute or start with ~/, ignoring entry

What it means

Validation in `resolve_entry` for dotfile edit entries: the entry's `path` resolves to a relative filesystem path (not absolute and not starting with `~/`), which would be ambiguous against the working directory, so the entry is rejected.

Solutions

  1. Make the path absolute: `/home/me/dotfiles/zshrc`, or home-relative: `~/dotfiles/zshrc`.
  2. If you meant a path relative to the config file, expand it yourself or use the documented `{{ config_root }}` templating instead of a bare relative path.
  3. Check any env-var/tilde expansion in the path value that may be stripping the leading `/` or `~/`.

Example fix

# before
[[edits]]
path = "dotfiles/zshrc"
id = "alias"
# after
[[edits]]
path = "~/dotfiles/zshrc"
id = "alias"
Defensive patterns

Strategy: validation

Validate before calling

let p = shellexpand::tilde(&raw);
assert!(std::path::Path::new(p.as_ref()).is_absolute(), "edit path must be absolute or start with ~/: {raw}");

Type guard

fn is_editable_path(raw: &str) -> bool {
    raw.starts_with("~/") || std::path::Path::new(shellexpand::tilde(raw).as_ref()).is_absolute()
}

Prevention

When it happens

Trigger: An [[edit]]-style TOML entry whose path is e.g. `dotfiles/zshrc` or `./zshrc` — anything that after `file::replace_path` is still relative — passed into `resolve_entry` from `edits_from_config_files`.

Common situations: Authors assuming paths are resolved relative to the config file's directory; using `~` without the slash (e.g. `~user/...` handled oddly); environment-variable expansion that produces an empty prefix leaving a relative path.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/system/edits.rs:268

fn split_edit_key(path_and_id: &str) -> Option<(String, String)> {
    let (path, id) = path_and_id.rsplit_once('/')?;
    if path.is_empty() || path == "~" || path == "/" || id.is_empty() {
        return None;
    }
    Some((path.to_string(), id.to_string()))
}

fn resolve_entry(
    path_raw: &str,
    id: String,
    entry: EditTomlEntry,
    base: &Path,
    config_path: &Path,
) -> Result<EditRequest> {
    let path = file::replace_path(path_raw);
    if path.is_relative() {
        bail!("path \"{path_raw}\" must be absolute or start with ~/, ignoring entry");
    }
    // ids end up inside marker lines — keep them to characters that can't
    // collide with the marker syntax itself
    if id.is_empty() || !id.chars().all(|c| c.is_alphanumeric() || "_-.".contains(c)) {
        bail!(
            "\"{path_raw}\".{id:?}: ids may only contain letters, digits, '_', '-', and '.', ignoring entry"
        );
    }
    let mut origin = ResourceOrigin {
        config: config_path.to_path_buf(),
        config_root: crate::config::config_file::config_root::config_root(config_path),
        environment: crate::config::environments_for_config_path(config_path),
        source: None,
    };
    let entry = match entry {
        EditTomlEntry::Block(inline) => EditTomlTable {
            block: Some(inline),
            source: None,

View on GitHub (pinned to 533346cc37)