{"record":{"id":"2c95455693b23ee3","repo":"jdx/mise","slug":"workspace-project-depends-on-unknown-project","errorCode":null,"errorMessage":"workspace project {:?} depends on unknown project {:?}","messagePattern":"workspace project (.+?) depends on unknown project (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace.rs","lineNumber":1046,"sourceCode":"            if !visited.insert(dependency_id.clone()) {\n                continue;\n            }\n            self.collect_matching_dependencies(dependency_id, visited, matches, matching);\n            let dependency = self\n                .projects\n                .get(dependency_id)\n                .expect(\"workspace project graph is validated\");\n            if matches(dependency) {\n                matching.push(dependency);\n            }\n        }\n    }\n\n    fn validate(&self) -> Result<()> {\n        for project in self.projects() {\n            for dependency in &project.dependencies {\n                if self.get(dependency).is_none() {\n                    bail!(\n                        \"workspace project {:?} depends on unknown project {:?}\",\n                        project.id,\n                        dependency\n                    );\n                }\n            }\n        }\n        if let Some(path) = self.find_cycle() {\n            return Err(WorkspaceProjectCycleError { path }.into());\n        }\n        Ok(())\n    }\n\n    fn find_cycle(&self) -> Option<Vec<ProjectId>> {\n        let mut visited = BTreeSet::new();\n        let mut active = BTreeMap::new();\n        let mut path = Vec::new();\n        for id in self.projects.keys() {","sourceCodeStart":1028,"sourceCodeEnd":1064,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/workspace.rs#L1028-L1064","documentation":"During Workspace::validate, every project's dependency id is resolved against the workspace's project map. If a declared dependency does not correspond to any defined workspace project, mise throws this error naming both the depending project and the unknown dependency. This keeps the dependency graph closed over defined projects.","triggerScenarios":"A project's depends (or computed dependencies after depends_add/depends_remove) contains a ProjectId absent from the workspace's project definitions, detected at workspace validation time.","commonSituations":"Typo in a depends entry; referencing a project from another workspace; deleting a project table without cleaning up its dependents' depends lists.","solutions":["Fix or remove the unknown dependency id in the named project's depends list","Add the missing [workspace.project] definition if the dependency should exist","Re-run validation after edits to catch any remaining dangling references"],"exampleFix":"# before\n[workspace.project.app]\ndepends = [\"utile\"]\n# after\n[workspace.project.app]\ndepends = [\"util\"]","handlingStrategy":"validation","validationCode":"fn validate_deps(ws: &Workspace) -> Result<(), String> {\n    for p in ws.projects() {\n        for d in &p.dependencies {\n            if ws.get(d).is_none() {\n                return Err(format!(\"{} depends on undefined project {:?}\", p.id, d));\n            }\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = ws.validate() {\n    if e.to_string().contains(\"depends on unknown project\") {\n        eprintln!(\"fix depends lists in workspace config: {e}\");\n    } else {\n        return Err(e);\n    }\n}","preventionTips":["When deleting a [workspace.project] table, immediately grep for its id in all depends lists","Use ids copied from defined tables, not retyped from memory","Run mise's config validation (e.g. mise task ls) after every workspace config edit"],"tags":["workspace","config","dependency-graph"],"backgroundTag":"entity-not-found","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"}