jdx/mise · error

" ". : ids may only contain letters, digits, '_', '-', and…

Error message

"{path_raw}".{id:?}: ids may only contain letters, digits, '_', '-', and '.', ignoring entry

What it means

Validation in `resolve_entry`: the entry's `id` is empty or contains characters outside letters, digits, `_`, `-`, and `.`. Ids are embedded in edit marker lines written into dotfiles, so permissive characters could collide with the marker syntax; such entries are rejected.

Solutions

  1. Set a non-empty id using only letters, digits, `_`, `-`, `.` (e.g. `id = "git_alias"`).
  2. Replace spaces and punctuation with `-` or `_` in the id.
  3. Ensure the templating/generator emitting the entries produces sanitized ids.

Example fix

# before
[[edits]]
path = "~/.zshrc"
id = "git: alias"
# after
[[edits]]
path = "~/.zshrc"
id = "git-alias"
Defensive patterns

Strategy: validation

Validate before calling

let valid = !id.is_empty() && id.chars().all(|c| c.is_alphanumeric() || "_-.".contains(c));
assert!(valid, "invalid edit id: {id:?}");

Type guard

fn is_valid_edit_id(id: &str) -> bool {
    !id.is_empty() && id.chars().all(|c| c.is_alphanumeric() || "_-.".contains(c))
}

Prevention

When it happens

Trigger: An edit entry with `id = ""`, or ids containing spaces, `:`, `/`, quotes, or other punctuation (e.g. `id = "my alias"`, `id = "git:main"`) resolved via `edits_from_config_files`.

Common situations: Leaving the id blank in a hastily written [[edit]] block; using human phrases with spaces as ids; ids copied from file paths or URLs containing `/` and `:`.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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

Appendix: source

Thrown at src/system/edits.rs:273

    }
    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,
            template: None,
            line: None,
            position: None,
            comment: None,
        },

View on GitHub (pinned to 533346cc37)