jdx/mise · error

output {} does not exist

Error message

output {} does not exist

What it means

mise's task cache records which cache output roots it will save/restore. When resolving a task's declared output patterns with match-required semantics (require_matches=true), each non-glob output must actually exist on disk under the task directory. If a declared output path is missing entirely — neither the file/dir itself nor a symlink to it can be stat'ed — mise bails so it never silently caches a task whose outputs weren't produced.

Source

Thrown at src/task/task_cache.rs:1309

                    if is_output(&matcher, &path, is_dir) {
                        resolved.insert(rel);
                    }
                }
            }
            if require_matches && !glob_matched {
                bail!("output pattern {output:?} matched no files");
            }
        } else {
            let rel = PathBuf::from(&output);
            let abs = root.join(&rel);
            let is_dir = fs::symlink_metadata(&abs)
                .map(|metadata| metadata.is_dir())
                .unwrap_or(false);
            if !is_output(&matcher, &abs, is_dir) {
                continue;
            }
            if require_matches && !abs.exists() && fs::symlink_metadata(&abs).is_err() {
                bail!("output {} does not exist", rel.display());
            }
            resolved.insert(rel);
        }
    }
    Ok(resolved.into_iter().collect())
}

fn remove_nested_roots(mut roots: Vec<PathBuf>) -> Vec<PathBuf> {
    roots.sort_by_key(|path| path.components().count());
    let mut result = Vec::<PathBuf>::new();
    for root in roots {
        if !result.iter().any(|parent| root.starts_with(parent)) {
            result.push(root);
        }
    }
    result.sort();
    result
}

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Run the task's script manually and confirm the declared output path is actually created under the task root
  2. Fix the outputs entry in mise.toml (correct path, or use a glob pattern like dist/** if the file name varies)
  3. If an output is legitimately optional/conditional, make the task always create it (e.g. mkdir -p / touch) or remove it from outputs
  4. Check that earlier steps in the task (file_out, depends) actually ran and produced the artifact

Example fix

// before (mise.toml)
[tasks.build]
outputs = ["dist/bundle.js"]  # build writes dist/js/bundle.js
// after
[tasks.build]
outputs = ["dist/js/bundle.js"]
Defensive patterns

Strategy: validation

Validate before calling

# before relying on cache, verify declared outputs exist
for f in $OUTPUTS; do
  [ -e "$f" ] || [ -L "$f" ] || { echo "missing task output: $f" >&2; exit 1; }
done

Try / catch

// rust: treat the bail as 'outputs missing', regenerate instead of failing
match resolve_output_roots(&task, &root, true) {
    Ok(roots) => roots,
    Err(e) if e.to_string().contains("does not exist") => {
        rerun_task(&task)?; // regenerate outputs then retry
        resolve_output_roots(&task, &root, true)?
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Running a cached task (mise run/task execution with task cache enabled) whose outputs list names a concrete path (non-glob) that the task script did not create, or that was deleted before the cache-save step calls resolve_output_roots(root, require_matches=true). Also triggered when the output only matches the output matcher but abs.exists() is false and fs::symlink_metadata fails (dangling or absent path).

Common situations: Config mistakes: typo'd path in [tasks.x].outputs or outputs referencing files written under a different directory; a build tool conditionally skipping output generation; a task script failing silently but exiting 0; outputs created outside the task root; cleaning the output dir between build and cache save.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/7c1b759b25484de2. Report an issue: GitHub.