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
- Remove the `position` field from the block/source entry.
- Switch the entry to `line = ...` if you actually want append/prepend positioning.
- 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
- Only add `position` to entries that use `line`.
- When switching an entry between line and block styles, audit all auxiliary fields.
- Keep block entries minimal: block/source plus optional template/comment only.
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
- destination variants require an explicit source when any…
- destination variants with inline content are not supported
- [dotfiles]." / ": block content may not contain its own…
- [dotfiles]." ": mode symlink-each requires a directory…
- files
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)