jdx/mise · error

[dotfiles]." ": manifest requires the source to be a…

Error message

[dotfiles]."{}": manifest requires the source to be a directory: {}

What it means

A dotfile entry that declares a `manifest` is treated as a directory-of-files manifest. During `validate_composed_file_footprints`, if the entry has a manifest, the source exists on disk, but the source is a regular file rather than a directory, validation fails because a manifest only makes sense over a directory tree.

Solutions

  1. Point `source` at a directory that contains the manifest and its files
  2. Remove the `manifest` key if the source really is a single file
  3. Create the expected directory structure and move the file inside it

Example fix

// before
"~/.config/app" = { source = "dotfiles/app.conf", manifest = true }
// after
"~/.config/app" = { source = "dotfiles/app", manifest = true }  # dotfiles/app/ is a directory
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
function manifestSourceOk(entry) {
  if (!entry || !entry.manifest || !entry.source) return true;
  return !fs.existsSync(entry.source) || fs.statSync(entry.source).isDirectory();
}

Type guard

const isDir = (p: string) => { try { return require('fs').statSync(p).isDirectory(); } catch { return false; } };

Prevention

When it happens

Trigger: Setting `manifest = true` (or an equivalent manifest key) on an entry whose `source` points at a single file that exists, in any non-Track mode.

Common situations: Pointing the source at `dotfiles/gitconfig` (a file) instead of a directory containing a manifest; renaming directories so the source now resolves to a leftover file.

Related errors


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

Appendix: source

Thrown at src/system/files.rs:520

}

/// Validate the complete paths claimed by composed `[dotfiles]` entries.
/// Directory copies and `symlink-each` entries may share directories, but no
/// two entries may own the same leaf or require a directory where another
/// entry places a leaf.
pub(crate) fn validate_composed_file_footprints(requests: &[FileRequest]) -> Result<()> {
    let mut leaves: IndexMap<PathBuf, &FileRequest> = IndexMap::new();
    let mut directories: IndexMap<PathBuf, &FileRequest> = IndexMap::new();
    let mut symlink_each_identities: HashMap<(&Path, &Path), &FileRequest> = HashMap::new();

    for request in requests {
        // Tracking observes native files; it does not own an apply leaf.
        // A tracked parent may contain independently managed destinations.
        if request.mode == FileMode::Track {
            continue;
        }
        if request.manifest.is_some() && request.source.exists() && !request.source.is_dir() {
            bail!(
                "[dotfiles].\"{}\": manifest requires the source to be a directory: {}",
                request.target_raw,
                request.source.display_user()
            );
        }
        if request.mode == FileMode::SymlinkEach
            && let Some(existing) = symlink_each_identities.insert(
                (request.source.as_path(), request.target.as_path()),
                request,
            )
        {
            return Err(composed_file_footprint_conflict(
                &request.target,
                existing,
                request,
            ));
        }
        // A missing source has an unknown eventual shape, but it still claims

View on GitHub (pinned to 533346cc37)