jdx/mise · error

" ". : position is only valid with line, ignoring entry

Error message

"{path_raw}".{id}: position is only valid with line, ignoring entry

What it means

The `position` field (append/prepend) only applies to line-based edits. When an entry uses a `block` or `source` operation but also sets `position`, `resolve_entry` bails and ignores the entry, because block placement is controlled by markers, not by line positioning.

Solutions

  1. Remove the `position` field from the block/source entry.
  2. Switch the entry to `line = ...` if you actually want append/prepend positioning.
  3. Re-run `mise edits` and confirm the entry is applied.

Example fix

# before
[dotfiles."~/.gitconfig".alias-block]
block = "[alias]\n  st = status"
position = "append"

# after
[dotfiles."~/.gitconfig".alias-block]
block = "[alias]\n  st = status"
Defensive patterns

Strategy: validation

Validate before calling

if (e.block.is_some() || e.source.is_some()) && e.position.is_some() {
    return Err("position is only meaningful for line edits; remove it".into());
}

Prevention

When it happens

Trigger: A block/source edit entry includes `position = "append"` or `position = "prepend"`. `resolve_entry` matches `(is_block=true, line=None)`, sees `entry.position.is_some()`, and bails at src/system/edits.rs:308.

Common situations: Users convert a line edit into a block edit (or vice versa) and leave `position` behind, or copy the `position` key from a neighboring line-based entry.

Related errors


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

Appendix: source

Thrown at src/system/edits.rs:308

            comment: None,
        },
        EditTomlEntry::Table(table) => table,
    };
    let is_block = entry.block.is_some() || entry.source.is_some();
    let op = match (&is_block, &entry.line) {
        (true, Some(_)) => {
            bail!(
                "\"{path_raw}\".{id}: block/source and line are mutually exclusive, ignoring entry"
            )
        }
        (false, None) => {
            bail!(
                "\"{path_raw}\".{id}: no recognized operation (block, source, or line), ignoring entry"
            )
        }
        (true, None) => {
            if entry.position.is_some() {
                bail!("\"{path_raw}\".{id}: position is only valid with line, ignoring entry")
            }
            let source = match (entry.block, entry.source) {
                (Some(_), Some(_)) => {
                    bail!(
                        "\"{path_raw}\".{id}: block and source are mutually exclusive, ignoring entry"
                    )
                }
                (Some(inline), None) => BlockSource::Inline(inline),
                (None, Some(src)) => {
                    let src = file::replace_path(&src);
                    let src = if src.is_relative() {
                        base.join(src)
                    } else {
                        src
                    };
                    origin.source = Some(src.clone());
                    BlockSource::File(src)
                }

View on GitHub (pinned to 533346cc37)