{"record":{"id":"8b627bfa9207b716","repo":"jdx/mise","slug":"command-wrapper-for-shim-name-cannot-delegate-to","errorCode":null,"errorMessage":"command wrapper for {shim_name} cannot delegate to itself","messagePattern":"command wrapper for (.+?) cannot delegate to itself","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shims.rs","lineNumber":236,"sourceCode":"        .with_resolve_options(resolve_options)\n        .build(config)\n        .await?;\n    let wrappers = load_command_wrappers(\n        &config.config_files,\n        ts.versions.values().flat_map(|versions| &versions.requests),\n    )?;\n    validate_wrapper_names(wrappers.keys())?;\n    let wrapper = if cfg!(macos) {\n        wrappers\n            .iter()\n            .find(|(name, _)| command_names_eq(name, shim_name))\n            .map(|(_, wrapper)| wrapper)\n    } else {\n        wrappers.get(shim_name)\n    };\n    if let Some(wrapper) = wrapper {\n        if command_names_eq(wrapper.command(), shim_name) {\n            bail!(\"command wrapper for {shim_name} cannot delegate to itself\");\n        }\n        trace!(\"shim[{bin_name}] WRAPPER command: {}\", wrapper.command());\n        return Ok((PathBuf::from(wrapper.command()), ts, Some(wrapper.clone())));\n    }\n    // A configured tool may intentionally override an executable bundled by another installed\n    // tool (for example, a pinned npm overrides Node's npm). Install a missing provider declared\n    // by the registry before resolving an incidental installed provider.\n    if !completion_offline\n        && Settings::get().not_found_auto_install\n        && ts\n            .should_install_missing_registry_bin_provider(config, shim_name)\n            .await?\n    {\n        for tv in ts\n            .install_missing_bin(config, shim_name)\n            .await?\n            .unwrap_or_default()\n        {","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/shims.rs#L218-L254","documentation":"which_shim matched a command wrapper for the shim being resolved and found the wrapper's own command name equals the shim name. Executing it would recurse forever (shim → wrapper → shim), so mise refuses to delegate.","triggerScenarios":"Thrown at src/shims.rs:236 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the wrapper or the tool so the wrapper's `command` points to a different name","Point the wrapper at an absolute path to the real binary","Disable the conflicting command wrapper in config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}