jdx/mise · error
"{path_raw}".{id}: position is only valid with line, ignorin
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 edit entries; block/source edits manage their content via marker lines and cannot be positioned. resolve_entry raises this error and ignores the entry when `position` is set together with a block/source entry (is_block=true, no line).
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 afd2eddd3a)
Solutions
- Remove the `position` field from the block/source entry.
- If positioning is truly needed, use a `line` entry with position instead.
- Keep `position` only if you also keep `line` and drop block/source.
Example fix
// before [[dotfiles]] id = "aliases" path = "~/.zshrc" block = "alias gs='git status'" position = "append" // after [[dotfiles]] id = "aliases" path = "~/.zshrc" block = "alias gs='git status'"
Defensive patterns
Strategy: validation
Validate before calling
for entry in dotfile_entries {
if (entry.block.is_some() || entry.source.is_some()) && entry.position.is_some() {
panic!("entry {}: position only applies to line entries", entry.id);
}
} Prevention
- Associate position only with line entries when writing configs.
- Strip position when converting a line entry to a block entry.
- Document team config conventions so blocks are never given position.
When it happens
Trigger: A [dotfiles] entry sets `block` (or `source`) plus `position = "append"` or `"prepend"` without a `line` field.
Common situations: Copy-pasting a line entry and switching it to block but keeping the position setting; assuming position also controls where a block is placed.
Related errors
- dotfiles: {key} could not be tracked: {reason}
- [dotfiles]."{req.target_raw}": mode symlink-each requires a
- "{path_raw}".{id}: block/source and line are mutually exclus
- "{path_raw}".{id}: no recognized operation (block, source, o
- "{path_raw}".{id}: block and source are mutually exclusive,
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/acc374c446648123.
Report an issue: GitHub.