{"record":{"id":"103075d7ef54f781","repo":"jdx/mise","slug":"depends-on-unknown","errorCode":null,"errorMessage":"'{}' depends on unknown '{}'","messagePattern":"'(.+?)' depends on unknown '(.+?)'","errorType":"exception","errorClass":null,"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/533346cc374382b41ec5ff70536252b2e96e725c/src/deps_graph.rs#L48-L84","documentation":"When building the dependency graph, each edge's endpoints must already exist as nodes. If a dependency declares an edge to a key that was never registered as a node, the graph would be inconsistent, so `DepsGraph::new` bails naming the depending and missing keys.","triggerScenarios":"Constructing `DepsGraph::new` from a node/edge list where an edge's `to_key` has no corresponding entry in `node_indices` (the `from` side is silently skipped if unknown; only unknown `to` targets are fatal).","commonSituations":"Deps config referencing a provider/package key with a typo; an edge added programmatically for a node filtered out earlier (e.g. skipped provider); stale cross-references after renaming a dep key.","solutions":["Fix the target key in the dependency declaration to match an existing node","Add the missing node so the edge target exists","Remove the stale dependency edge from the config"],"exampleFix":"// before (mise.toml)\n[deps]\n\"app\" depends-on \"srev\"   # typo: unknown node\n// after\n[deps]\n\"app\" depends-on \"serv\"","handlingStrategy":"validation","validationCode":"let known: HashSet<&str> = nodes.iter().map(|n| n.key()).collect();\nlet bad: Vec<_> = edges.iter().filter(|(_, to)| !known.contains(to.as_str())).collect();\nif !bad.is_empty() { eprintln!(\"edges targeting unknown nodes: {bad:?}\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep dep keys in one canonical place to avoid typos","Lint deps config for dangling references before running","Rename keys with search/replace across the whole config"],"tags":["deps","graph","config"],"backgroundTag":"resource-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"}