{"record":{"id":"103075d7ef54f781","repo":"jdx/mise","slug":"depends-on-unknown","errorCode":null,"errorMessage":"'{}' depends on unknown '{}'","messagePattern":"'(.+?)' depends on unknown '(.+?)'","errorType":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/deps_graph.rs","lineNumber":66,"sourceCode":"        key_fn: fn(&N) -> K,\n    ) -> Result<Self> {\n        let mut graph = StableGraph::new();\n        let mut node_indices = HashMap::new();\n\n        for (key, node) in nodes {\n            if node_indices.contains_key(&key) {\n                continue;\n            }\n            let idx = graph.add_node(node);\n            node_indices.insert(key, idx);\n        }\n\n        for (from_key, to_key) in edges {\n            let Some(&from_idx) = node_indices.get(&from_key) else {\n                continue;\n            };\n            let Some(&to_idx) = node_indices.get(&to_key) else {\n                bail!(\"'{}' depends on unknown '{}'\", from_key, to_key);\n            };\n            if from_key != to_key {\n                graph.update_edge(from_idx, to_idx, ());\n            }\n        }\n\n        let (tx, _) = mpsc::unbounded_channel();\n\n        let mut deps = Self {\n            graph,\n            node_indices,\n            sent: HashSet::new(),\n            blocked: HashSet::new(),\n            tx,\n            key_fn,\n        };\n\n        deps.detect_and_block_cycles();","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/deps_graph.rs#L48-L84","documentation":"`DepsGraph::new` (src/deps_graph.rs) builds a petgraph from node keys plus `(from, to)` edges. An unknown `from` is silently skipped (`continue`), but an edge whose `to` key has no registered node bails: that dependency could never be fulfilled/awaited, which usually indicates a `depends` reference to a task that does not exist or was not loaded.","triggerScenarios":"Constructing the task dependency graph with an edge whose target key is not among the nodes — e.g. a task declares `depends = [\"lint\"]` but `lint` is not defined in any loaded config, is disabled by platform/run filters, or has a name variant (`build:web` matrix naming) that does not match the node key.","commonSituations":"Typos in `depends` entries; depending on tasks defined in a config file that isn't included in that context; tasks removed during refactoring while dependents remain; file-task vs named-task mismatches; matrix task name formats differing from what dependents wrote.","solutions":["Read the message: task `<from_key>` depends on `<to_key>`, which mise cannot find as a node","Fix the name typo, or define/load the missing task in the same config context","If the dependency is conditionally defined, make its definition unconditional or remove the `depends` entry when it's absent","Confirm the exact task names as mise sees them with `mise tasks ls`"],"exampleFix":"# before\n[tasks.build]\ndepends = ['lnt']   # typo, no task 'lnt'\n\n# after\n[tasks.build]\ndepends = ['lint']\n\n[tasks.lint]\nrun = \"echo lint\"","handlingStrategy":"validation","validationCode":"# verify every depends target exists as a task before running\nimport tomllib, sys\ncfg = tomllib.load(open(\"mise.toml\", \"rb\"))\ntasks = cfg.get(\"tasks\", {})\nfor name, t in tasks.items():\n    for dep in t.get(\"depends\", []):\n        dep = dep.split(\":\")[0] if isinstance(dep, str) else dep\n        if dep not in tasks:\n            sys.exit(f\"task {name} depends on unknown task {dep!r}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `mise tasks ls` after adding/removing tasks to confirm names resolve","When deleting a task, grep all configs for its name in depends lists first","Keep matrix task naming consistent (`name:variant`) between producers and dependents"],"tags":["mise","tasks","deps","graph","config"],"backgroundTag":"dependency-graph-validation","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}