jdx/mise · error

^task dependencies are supported only in depends

Error message

^task dependencies are supported only in depends

What it means

The `^` prefix on a dependency means 'run after the main task' and is only honored in `depends`. During validation, mise checks `depends_post` and `wait_for` entries and bails if any of them start with '^', because the semantics would be redundant/undefined there.

Solutions

  1. Remove the '^' prefix from the depends_post or wait_for entry — depends_post already means 'after'
  2. If you truly want it as a normal post-dependency, put the plain task name in depends_post instead

Example fix

// before
[tasks.ci]
depends_post = ["^lint"]

// after
[tasks.ci]
depends_post = ["lint"]
Defensive patterns

Strategy: validation

Validate before calling

# reject caret prefixes outside depends in task definitions
awk '/^(depends_post|wait_for)/ && /\^/ { print FILENAME ": " $0; bad=1 } END { exit bad }' mise.toml .mise.toml 2>/dev/null

Prevention

When it happens

Trigger: Declaring a task with `depends_post = ["^other"]` or `wait_for = ["^other"]` in mise.toml, then the task graph is validated (e.g. during `mise run` or config load of the task).

Common situations: Users copying a `depends = ["^build"]` entry and pasting it into depends_post or wait_for, assuming the caret carries over.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at src/task/mod.rs:1800

        })
    }

    /// Expands `^task` dependencies to the matching task in every upstream workspace project.
    ///
    /// Each expanded dependency is optional because not every project in the dependency closure
    /// needs to implement the requested task. The workspace graph traversal still continues
    /// through those projects so matching tasks farther upstream are retained.
    pub(crate) fn resolve_workspace_task_dependencies(
        &mut self,
        graph: &workspace::WorkspaceProjectGraph,
        project_ids_by_root: &BTreeMap<PathBuf, BTreeSet<workspace::ProjectId>>,
    ) -> Result<()> {
        if self
            .depends_post
            .iter()
            .chain(&self.wait_for)
            .any(|dep| dep.task.starts_with('^'))
        {
            bail!("^task dependencies are supported only in depends");
        }
        if !self.depends.iter().any(|dep| dep.task.starts_with('^')) {
            return Ok(());
        }

        let mut project_ids = BTreeSet::new();
        let stable_task_names = once(self.name.as_str())
            .chain(self.aliases.iter().map(String::as_str))
            .filter(|name| is_workspace_project_task(name))
            .collect_vec();

        for name in stable_task_names {
            let (project_id, _) = name
                .split_once('#')
                .expect("workspace project task contains #");
            if let Ok(project_id) = project_id.parse::<workspace::ProjectId>()
                && graph.get(&project_id).is_some()

View on GitHub (pinned to 533346cc37)