{"record":{"id":"6188f9a754eb93cb","repo":"DioxusLabs/dioxus","slug":"failed-to-find-package-package","errorCode":null,"errorMessage":"Failed to find package {package}","messagePattern":"Failed to find package (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/workspace.rs","lineNumber":339,"sourceCode":"                        return Some(id);\n                    }\n                }\n                None\n            });\n\n            if found.is_none() {\n                tracing::error!(\n                    \"Could not find package {package} in the workspace. Did you forget to add it to the workspace?\"\n                );\n                tracing::error!(\"Packages in the workspace:\");\n                for package in self.krates.workspace_members() {\n                    if let krates::Node::Krate { krate, .. } = package {\n                        tracing::error!(\"{}\", krate.name());\n                    }\n                }\n            }\n\n            let kid = found.ok_or_else(|| anyhow::anyhow!(\"Failed to find package {package}\"))?;\n\n            return Ok(self.krates.nid_for_kid(kid).unwrap());\n        };\n\n        // if we have default members specified, try them first\n        if let Some(ws) = &self.cargo_toml.workspace {\n            for default in &ws.default_members {\n                let mut workspace_members = self.krates.workspace_members();\n                let default_member_path = std::fs::canonicalize(default).unwrap();\n\n                let found = workspace_members.find_map(|node| {\n                    if let krates::Node::Krate { id, krate, .. } = node {\n                        // Skip this default member if it doesn't have any binary targets\n                        if !krate\n                            .targets\n                            .iter()\n                            .any(|t| t.kind.contains(&krates::cm::TargetKind::Bin))\n                        {","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/workspace.rs#L321-L357","documentation":"Failure of Workspace::find_main_package after exhaustive search of workspace members: the requested package name is not a member of the current cargo workspace. Diagnostic errors listing all workspace members are logged first; the faulting input is the package name from CLI/config that must be added to the workspace.","triggerScenarios":"Thrown at packages/cli/src/workspace.rs:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The package was not found in the workspace. Check the package name in Cargo.toml."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}