{"record":{"id":"d4022a0a357f8d04","repo":"jdx/mise","slug":"path-raw-id-line-may-not-contain-a-newline","errorCode":null,"errorMessage":"\"{path_raw}\".{id}: line may not contain a newline; use a block for multi-line content, ignoring entry","messagePattern":"\"(.+?)\"\\.(.+?): line may not contain a newline; use a block for multi-line content, ignoring entry","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/edits.rs","lineNumber":352,"sourceCode":"                        \"\\\"{path_raw}\\\".{id}: unknown template engine '{other}' (expected \\\"tera\\\"), ignoring entry\"\n                    )\n                }\n            };\n            let comment = entry\n                .comment\n                .unwrap_or_else(|| infer_comment(&path).to_string());\n            EditOp::Block {\n                source,\n                template,\n                comment,\n            }\n        }\n        (false, Some(line)) => {\n            // a \"line\" is matched against the file's individual lines, so an\n            // embedded newline could never converge — use a block for\n            // multi-line content\n            if line.contains('\\n') {\n                bail!(\n                    \"\\\"{path_raw}\\\".{id}: line may not contain a newline; use a block for multi-line content, ignoring entry\"\n                )\n            }\n            let position = match entry.position.as_deref() {\n                None | Some(\"append\") => LinePosition::Append,\n                Some(\"prepend\") => LinePosition::Prepend,\n                Some(other) => {\n                    bail!(\n                        \"\\\"{path_raw}\\\".{id}: unknown line position '{other}' (expected \\\"append\\\" or \\\"prepend\\\"), ignoring entry\"\n                    )\n                }\n            };\n            EditOp::Line {\n                line: line.clone(),\n                position,\n            }\n        }\n    };","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/edits.rs#L334-L370","documentation":"Line-based edits match against individual lines of the target file, so a `line` value containing an embedded newline could never converge on a stable match. resolve_entry raises this error and ignores the entry; multi-line managed content must use `block` instead.","triggerScenarios":"A [dotfiles] entry has `line = \"first\\nsecond\"` (a literal newline inside the line string), typically from a multi-line TOML string or interpolated content.","commonSituations":"Pasting a multi-line snippet into a line field; building the line value dynamically (e.g. via Tera) where the rendered result contains newlines; copy-paste mistakes between block and line.","solutions":["Rename the field from `line` to `block` and keep the multi-line content.","Split the content into multiple entries, one per line, with distinct ids.","Strip or escape the newline if a single logical line was intended."],"exampleFix":"// before\n[[dotfiles]]\nid = \"aliases\"\npath = \"~/.zshrc\"\nline = \"\"\"alias gs='git status'\nalias gl='git log'\"\"\"\n\n// after\n[[dotfiles]]\nid = \"aliases\"\npath = \"~/.zshrc\"\nblock = \"\"\"alias gs='git status'\nalias gl='git log'\"\"\"","handlingStrategy":"validation","validationCode":"if let Some(line) = &entry.line {\n    assert!(!line.contains('\\n'), \"entry {}: line must be a single line; use block for multi-line\", entry.id);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep line values single-line; switch to block for any multi-line content.","Beware TOML multi-line strings (triple quotes) in a line field.","If templating a line value, ensure the rendered result has no newlines."],"tags":["config","validation","dotfiles"],"backgroundTag":"invalid-argument-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}