jdx/mise · error
task {} cache requires explicit outputs or outputs = []
Error message
task {} cache requires explicit outputs or outputs = [] What it means
validate_config requires explicit outputs for cached tasks: task.outputs must not be in Auto mode (TaskOutputs::Auto, i.e. outputs were never declared and mise would auto-manage them). The cache must know exactly which paths to save and restore, so either list output patterns or explicitly opt out with outputs = [].
Source
Thrown at src/task/task_cache.rs:1208
text.escape_debug().to_string()
}
/// Returns the versioned directory containing task artifact cache entries.
pub(crate) fn task_cache_dir() -> PathBuf {
Settings::get()
.task
.cache_dir
.clone()
.unwrap_or_else(|| dirs::CACHE.join("task-artifacts"))
.join(CACHE_DIR_VERSION)
}
pub(crate) fn validate_config(task: &Task, root: &Path) -> Result<()> {
if task.sources.is_empty() {
bail!("task {} cache requires at least one source", task.name);
}
if task.outputs.is_auto() {
bail!(
"task {} cache requires explicit outputs or outputs = []",
task.name
);
}
if let Some(command) = task.cache.as_ref().and_then(|cache| {
cache
.command_inputs
.iter()
.find(|command| command.trim().is_empty())
}) {
bail!(
"task {} cache command input must not be empty: {command:?}",
task.name
);
}
let patterns = task.outputs.patterns();
if !patterns.is_empty() && output_glob_patterns(&patterns).is_empty() {
bail!(View on GitHub (pinned to 6f52dcdf99)
Solutions
- Declare what the task produces: outputs = ["target/release/mybin", "dist/**"]
- If the task produces nothing worth restoring, declare that explicitly: outputs = []
- Re-run after editing to confirm validation passes before depending on the cache
Example fix
# before [tasks.build] cache = true sources = ["src/**"] run = "cargo build" # after [tasks.build] cache = true sources = ["src/**"] outputs = ["target/debug/mybin"]
Defensive patterns
Strategy: validation
Validate before calling
python3 - <<'EOF'
import tomllib, sys
cfg = tomllib.load(open('mise.toml','rb'))
for name, t in cfg.get('tasks', {}).items():
if t.get('cache') and 'outputs' not in t:
sys.exit(f'{name}: cached task needs explicit outputs (or outputs = [])')
print('ok')
EOF Prevention
- Cached tasks must declare outputs explicitly — auto outputs are never cacheable
- outputs = [] is the explicit 'no files' declaration
When it happens
Trigger: A cached task whose config omits any outputs key, leaving outputs in auto mode; the is_auto() check is the second validation in validate_config and fires before run.
Common situations: Turning on cache for an existing task that never declared outputs; assuming mise will figure out produced files automatically; config generated by a template that drops the outputs field.
Related errors
- task {} cache requires at least one source
- task {} cache command input must not be empty: {command:?}
- task {} cache outputs require at least one non-excluded patt
- task {} cache outputs must not contain source {}
- path must be a non-empty relative path
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/07b1f6aa4e6ebeb8.
Report an issue: GitHub.