jdx/mise · error

pre_use hook is not implemented

Error message

pre_use hook is not implemented

What it means

When a requested task name doesn't exist but other tasks do, mise builds a rich error listing similarly named commands and available tasks (append_available_tasks), suggesting the closest task and whether the user meant a mise command instead. It is the 'did you mean' variant of the not-found error.

Solutions

  1. Run the exact task name from the "Did you mean one of these?" list.
  2. Run `mise tasks` to see all available tasks in the current project.
  3. If the task lives in a subdirectory config, cd there or use the appropriate path-qualified task syntax.

Example fix

// before
mise run test-unit

// after
mise run test:unit   # exact name from suggestions
Defensive patterns

Strategy: try-catch

Validate before calling

# Confirm the exact task name exists before invoking
mise tasks ls | grep -qx "$task" || echo "task $task not defined"

Try / catch

// Parse the suggestion list from the failure and retry with the exact name
if (stderr.includes('Did you mean one of these?')) {
  const candidates = stderr.split('  - ').slice(1).map(s => s.trim());
}

Prevention

When it happens

Trigger: `mise run <name>` where <name> matches no task, tasks_for_error contains candidate tasks to suggest, and a similar command name may exist; raised from err_no_task via get_task_lists.

Common situations: Typos in task names (`mise run tesst` for `test`); task defined only in a subdirectory's config while running at the root; forgetting a task was renamed.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at crates/vfox/src/hooks/pre_use.rs:26

#[allow(dead_code)]
#[derive(Debug)]
pub(crate) struct PreUseContext {
    pub installed_sdks: IndexMap<String, SdkInfo>,
}

#[derive(Debug)]
pub struct PreUseResponse {
    pub version: Option<String>,
}

impl Plugin {
    pub async fn pre_use(&self, _vfox: &Vfox, _legacy_file: &Path) -> Result<PreUseResponse> {
        debug!("[vfox:{}] pre_use", self.name);
        // let ctx = PreUseContext {
        //     installed_sdks: vfox.list_installed_versions(&self.name)?,
        // };

        unimplemented!("pre_use hook is not implemented");
    }
}

View on GitHub (pinned to 533346cc37)