jdx/mise · error
tracked file {target} cannot declare source, content, manife
Error message
tracked file {target} cannot declare source, content, manifest, or exclude What it means
`mode = "track"` marks an already-existing file for tracking in the dotfiles root; it takes no provisioning inputs because the file is not copied, symlinked, or generated from a source. If a tracked entry declares `source`, `content`, `manifest`, or `exclude`, validation fails since those options contradict the track semantics.
Source
Thrown at src/system/files.rs:610
if content.is_some() && (mode.is_some() || exclude.is_some() || manifest.is_some())
{
bail!(
"dotfile {target}: inline content does not support mode, exclude, or manifest"
);
}
let mode = match mode.as_deref() {
Some(value) => FileMode::parse(value).ok_or_else(|| {
eyre::eyre!("unknown dotfile mode {value:?} for {target}")
})?,
None => default_mode(),
};
if mode == FileMode::Track
&& (source.is_some()
|| content.is_some()
|| manifest.is_some()
|| exclude.is_some())
{
bail!(
"tracked file {target} cannot declare source, content, manifest, or exclude"
);
}
if source.is_some() && content.is_some() {
bail!("dotfile {target} cannot declare both source and content");
}
if mode != FileMode::Track && source.is_none() && content.is_none() {
implied_source(&resolve_target_arg(&target))?;
}
if let Some(manifest) = manifest
&& (FileManifest::parse(&manifest).is_none()
|| !matches!(mode, FileMode::Copy | FileMode::SymlinkEach))
{
bail!("invalid manifest {manifest:?} for dotfile {target}");
}
for pattern in exclude.into_iter().flatten() {
glob::Pattern::new(&pattern)?;
}View on GitHub (pinned to afd2eddd3a)
Solutions
- Remove `source`, `content`, `manifest`, and `exclude` from the tracked entry; keep only `mode = "track"` (plus allowed keys like `encrypt`/`variants`).
- If the file actually needs to be provisioned from a source, drop `mode = "track"` and keep `source` with the appropriate mode (copy/symlink).
- Use track mode only for files that already exist on the machine and should be adopted into the dotfiles root.
Example fix
// before [dotfiles."~/.config/foo/bar.conf"] mode = "track" source = "bar.conf" // after [dotfiles."~/.config/foo/bar.conf"] mode = "track"
Defensive patterns
Strategy: validation
Validate before calling
function assertTrackEntry(entry, target) {
if (entry.mode === 'track' && ['source','content','manifest','exclude'].some(k => k in entry))
throw new Error(`${target}: tracked file cannot declare source/content/manifest/exclude`);
} Try / catch
try {
applyDotfiles();
} catch (e) {
if (/tracked file .* cannot declare/.test(e.message)) {
console.error('Keep only mode = "track" (and encrypt/variants/enabled) on tracked entries');
} else throw e;
} Prevention
- Use track mode only when adopting existing files; provisioning options belong to copy/symlink entries
- When flipping a mode to track, remove source/content/manifest/exclude in the same edit
- Add a config lint that enforces track-mode key restrictions
When it happens
Trigger: Setting `mode = "track"` on a `[dotfiles."~/..."]` entry while also specifying any of `source`, `content`, `manifest`, or `exclude`.
Common situations: Changing an existing copy/symlink entry to track mode without deleting its `source`/`exclude` keys, or adding `mode = "track"` to a templated config snippet that already had `source`.
Related errors
- invalid dotfile declaration {target} in {}
- unknown dotfile key {key:?} for {target} in {}
- dotfile {target}: inline content does not support mode, excl
- dotfile {target} cannot declare both source and content
- invalid manifest {manifest:?} for dotfile {target}
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/bb529b1b981c8571.
Report an issue: GitHub.