jdx/mise · error

output pattern matched no files

Error message

output pattern {output:?} matched no files

What it means

When a task cache output is a glob pattern and require_matches is set, resolve_output_roots fails if the glob matched zero files during its walk. mise needs at least one captured artifact to build a cache entry; a pattern matching nothing means the cache would be empty or the build didn't produce expected files.

Solutions

  1. Run the task's command and verify the files matching the pattern actually exist
  2. Fix the glob pattern to match real paths
  3. If zero matches is legitimate, adjust the outputs declaration or use a non-glob literal path that's checked for existence instead

Example fix

# before
outputs = ['dist/**/*.js']
# after (dir actually produced)
outputs = ['dist/']
Defensive patterns

Strategy: validation

Validate before calling

# shell check before relying on the cache
ls dist/*.js 2>/dev/null | head -n1 || echo 'pattern matches nothing'

Try / catch

if err contains 'matched no files':
    # build produced nothing; run task verbosely to see why
    rerun_task_with_verbose_output()

Prevention

When it happens

Trigger: Running a task whose `outputs` contains a glob like `dist/*.js` where dist/ is empty or doesn't exist, or the pattern is misspelled, at the point where the cache is being populated (save) with require_matches=true.

Common situations: Build silently failed before producing artifacts; pattern typo (`build/*.o` vs `out/*.o`); glob doesn't match on case-sensitive filesystems; outputs cleaned before 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@533346cc37 (2026-09-17). Data as JSON: /api/errors/d1388d609bad6331. Report an issue: GitHub.

Appendix: source

Thrown at src/task/task_cache.rs:1297

                for entry in glob_walk(&root.join(expanded), false)? {
                    let path = match entry {
                        Ok(entry) => entry.into_path(),
                        Err(err) => match symlink_walk_error_path(&err) {
                            Some(path) => path.to_path_buf(),
                            None => return Err(err.into()),
                        },
                    };
                    glob_matched = true;
                    let rel = path.strip_prefix(root)?.to_path_buf();
                    ensure_safe_relative(&rel)?;
                    let is_dir = fs::symlink_metadata(&path)?.is_dir();
                    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())
}

View on GitHub (pinned to 533346cc37)