{"record":{"id":"355c8490a7db3838","repo":"jdx/mise","slug":"unknown-shim-mode","errorCode":null,"errorMessage":"Unknown shim mode","messagePattern":"Unknown shim mode","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/shims.rs","lineNumber":1454,"sourceCode":"            })\n        }\n        \"hardlink\" => fs::hard_link(mise_bin, symlink_path).wrap_err_with(|| {\n            eyre!(\n                \"Failed to create hardlink from {} to {}\",\n                display_path(mise_bin),\n                display_path(symlink_path)\n            )\n        }),\n        \"symlink\" => {\n            std::os::windows::fs::symlink_file(mise_bin, symlink_path).wrap_err_with(|| {\n                eyre!(\n                    \"Failed to create symlink from {} to {}\",\n                    display_path(mise_bin),\n                    display_path(symlink_path)\n                )\n            })\n        }\n        _ => panic!(\"Unknown shim mode\"),\n    }\n}\n\n#[cfg(unix)]\nfn add_shim(mise_bin: &Path, symlink_path: &Path, _shim: &str) -> Result<()> {\n    file::make_symlink(mise_bin, symlink_path).wrap_err_with(|| {\n        eyre!(\n            \"Failed to create symlink from {} to {}\",\n            display_path(mise_bin),\n            display_path(symlink_path)\n        )\n    })?;\n    Ok(())\n}\n\npub(crate) struct ShimDiffs {\n    pub missing: BTreeSet<String>,\n    pub extra: BTreeSet<String>,","sourceCodeStart":1436,"sourceCodeEnd":1472,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/shims.rs#L1436-L1472","documentation":"add_shim() on Windows dispatches on the configured shim mode (MISE_WINDOWS_SHIM_MODE: 'symlink' vs 'file'); any unrecognized value falls through to an unconditional panic('Unknown shim mode'). Because the mode string is not validated at parse time, an invalid setting only explodes when mise tries to create shims.","triggerScenarios":"Calling add_shim() (via write_bootstrap_shims, stage_shim_farm, or sync_command_wrapper_shims) with a shim mode string other than the accepted 'symlink'/'file' variants — typically a typo'd or stale MISE_WINDOWS_SHIM_MODE environment variable or windows shim mode config setting.","commonSituations":"User sets MISE_WINDOWS_SHIM_MODE to a typo like 'symlinks' or leaves a value from an older mise version whose mode names have since changed; copy-pasting settings between machines; CI environment exporting a wrong mode.","solutions":["Set MISE_WINDOWS_SHIM_MODE to a valid value ('symlink' or 'file') or unset it to use the default","Check `mise settings` / global config for a misspelled windows shim mode entry and correct it","Upgrade mise — if a documented mode value was renamed, current code may accept the new name only"],"exampleFix":"// before\n$env:MISE_WINDOWS_SHIM_MODE = 'symlinks'\n// after\n$env:MISE_WINDOWS_SHIM_MODE = 'symlink'","handlingStrategy":"validation","validationCode":"$allowed = 'symlink','file'\nif ($env:MISE_WINDOWS_SHIM_MODE -and $allowed -notcontains $env:MISE_WINDOWS_SHIM_MODE) { throw \"MISE_WINDOWS_SHIM_MODE must be one of: $($allowed -join ', ')\" }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set MISE_WINDOWS_SHIM_MODE to documented values","Validate the setting at config-parse time rather than at shim creation time","Prefer unsetting the variable to get the default mode"],"tags":["rust","windows","shims","panic"],"backgroundTag":"invalid-enum-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}