jdx/mise · error

task includes do not contain an existing directory where a…

Error message

task includes do not contain an existing directory where a file task can be created

What it means

When loading task includes, mise needs a directory in which a file-based task can be created/registered, but none of the included paths contain an existing directory and no default create directory was supplied.

Solutions

  1. Ensure the include path/glob points at an existing directory containing task files
  2. Check the path is relative to the correct config file location
  3. Create the directory (or generate task files) before loading, or remove the include
  4. If submodules provide the tasks, run `git submodule update --init`

Example fix

# before (.mise/tasks referenced but missing)
includes = [".mise/tasks"]
# after: create the directory or fix the path
includes = ["tasks"] # where ./tasks exists in the config's directory
Defensive patterns

Strategy: validation

Validate before calling

# shell: ensure task include directories exist before invoking mise
for d in .mise/tasks tasks; do
  [ -d "$d" ] || echo "include dir missing: $d"
done

Type guard

// Rust
fn include_dir_exists(base: &Path, inc: &str) -> bool {
    base.join(inc).is_dir()
}

Try / catch

// Rust
match load_tasks(config).await {
    Ok(tasks) => use(tasks),
    Err(e) if e.to_string().contains("existing directory where a file task can be created") => {
        eprintln!("create the include directory or fix the include path");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Resolving a task include whose target does not yield an existing path and for which default_create_dir is None — include globs match nothing on disk, so there is no directory to anchor file tasks.

Common situations: Task includes pointing at directories that don't exist (yet), typo'd include globs, or include paths relative to a config whose base directory differs from expected; often after cloning a repo without submodules or before a generated directory exists.

Related errors


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

Appendix: source

Thrown at src/config/mod.rs:5398

    let default_create_dir = if uses_defaults {
        includes
            .first()
            .map(|include| resolve_dir.join(file::replace_path(include)))
    } else {
        None
    };
    if let Some(path) = includes
        .iter()
        .filter(|include| !include.starts_with("git::"))
        .flat_map(|include| expand_task_include(&resolve_dir, include))
        .find(|path| path.is_dir())
    {
        return Ok(path);
    }
    if let Some(dir) = default_create_dir {
        return Ok(dir);
    }
    bail!("task includes do not contain an existing directory where a file task can be created")
}

pub(crate) async fn load_tasks_in_dir(
    config: &Arc<Config>,
    dir: &Path,
    config_files: &ConfigMap,
) -> Result<Vec<Task>> {
    let workspace_graph = (Settings::get().experimental && config.monorepo_root().is_some())
        .then(|| config.workspace_project_graph_for_task_loading());
    let definitions = collect_task_definitions(
        config_files,
        workspace_graph
            .as_ref()
            .and_then(|graph| graph.as_ref().ok())
            .map(Arc::as_ref),
    );
    load_tasks_in_dir_with_definitions(config, dir, config_files, &definitions).await
}

View on GitHub (pinned to 533346cc37)