{"record":{"id":"8a9b039f0e127088","repo":"tauri-apps/tauri","slug":"failed-to-remove-cargo-dependency","errorCode":null,"errorMessage":"Failed to remove Cargo dependency","messagePattern":"Failed to remove Cargo dependency","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-cli/src/helpers/cargo.rs","lineNumber":95,"sourceCode":"  cargo.arg(\"remove\");\n\n  cargo.arg(options.name);\n\n  if let Some(target) = options.target {\n    cargo.args([\"--target\", target]);\n  }\n\n  if let Some(cwd) = options.cwd {\n    cargo.current_dir(cwd);\n  }\n\n  log::info!(\"Uninstalling Cargo dependency \\\"{}\\\"...\", options.name);\n  let status = cargo.status().map_err(|error| Error::CommandFailed {\n    command: \"cargo remove\".to_string(),\n    error,\n  })?;\n  if !status.success() {\n    crate::error::bail!(\"Failed to remove Cargo dependency\");\n  }\n\n  Ok(())\n}\n","sourceCodeStart":77,"sourceCodeEnd":100,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-cli/src/helpers/cargo.rs#L77-L100","documentation":"The mirror of the install helper: it runs `cargo remove <name>` with inherited stdio and reports failure when the command exits non-zero. Cargo's actual diagnostic (usually 'crate not found in dependencies') is printed above this message.","triggerScenarios":"`tauri remove <plugin>` (or internal cleanup paths) when the crate is not listed in `src-tauri/Cargo.toml` under that name, the manifest is in a conflicted/invalid state, or the manifest is read-only.","commonSituations":"Removing a plugin that was added manually with a different crate name (e.g. via a git rename); partial earlier failures that left Cargo.toml half-updated; removing from a workspace where the dependency lives in a different member's manifest.","solutions":["Check `src-tauri/Cargo.toml` for the exact dependency name and retry with that name","Run `cargo remove tauri-plugin-<name>` manually inside `src-tauri` to see cargo's full error","If Cargo.toml is conflicted or malformed, fix it first, then retry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# confirm the crate is actually declared before removing\ngrep -q '^tauri-plugin-' src-tauri/Cargo.toml   # or the exact crate name\n[ \"$(grep -c \"^${CRATE:-tauri-plugin-my-plugin}\" src-tauri/Cargo.toml)\" -ge 1 ] || { echo 'not in Cargo.toml'; exit 1; }\ntauri remove my-plugin","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `src-tauri/Cargo.toml` for the exact dependency name before removing","Remove plugins with the same tool/name they were added with","Fix conflicted or hand-broken manifests before running remove operations"],"tags":["tauri-cli","cargo","dependencies","uninstall"],"backgroundTag":"dependency-uninstall-failed","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}