{"record":{"id":"390c7f859207f027","repo":"sxyazi/yazi","slug":"was-not-found-in-package-toml","errorCode":null,"errorMessage":"`{}` was not found in package.toml","messagePattern":"`(.+?)` was not found in package\\.toml","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-cli/src/package/package.rs","lineNumber":121,"sourceCode":"\t\t\tbail!(\n\t\t\t\t\"{} `{}` already exists in package.toml\",\n\t\t\t\tif d.is_flavor { \"Flavor\" } else { \"Plugin\" },\n\t\t\t\tdep.name\n\t\t\t)\n\t\t}\n\n\t\tdep.add(false).await?;\n\t\tif dep.is_flavor {\n\t\t\tself.flavors.push(dep);\n\t\t} else {\n\t\t\tself.plugins.push(dep);\n\t\t}\n\t\tOk(())\n\t}\n\n\tasync fn delete(&mut self, r#use: &str, discard: bool) -> Result<()> {\n\t\tlet Some(dep) = self.identical(&Dependency::from_str(r#use)?).cloned() else {\n\t\t\tbail!(\"`{}` was not found in package.toml\", r#use)\n\t\t};\n\n\t\tdep.delete(discard).await?;\n\t\tif dep.is_flavor {\n\t\t\tself.flavors.retain(|d| !d.identical(&dep));\n\t\t} else {\n\t\t\tself.plugins.retain(|d| !d.identical(&dep));\n\t\t}\n\t\tOk(())\n\t}\n\n\tasync fn save(&self) -> Result<()> {\n\t\tlet s = toml::to_string_pretty(self)?;\n\t\tLocal::regular(&Self::toml()).write(s).await.context(\"Failed to write package.toml\")\n\t}\n\n\tfn toml() -> PathBuf { Xdg::config_dir().join(\"package.toml\") }\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-cli/src/package/package.rs#L103-L139","documentation":"This error fires from Package::delete when the user asks to remove a dependency (e.g. via `ya pack -d <name>`) whose name/ident does not match any plugin or flavor entry currently present in package.toml. It is a user-input validation guard: the requested `use` string is looked up against existing dependencies with Dependency::identical, and if no entry matches, the delete is aborted. It means the package was never installed or the name/URL was misspelled; nothing in package.toml was modified.","triggerScenarios":"Thrown at yazi-cli/src/package/package.rs:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List installed packages (`ya pkg list`) and use the exact `owner/repo` or `owner/repo:child` string.","Check for typos or a wrong child name in the dependency spec."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}