{"record":{"id":"e3c7f636f620f53c","repo":"elkowar/eww","slug":"inheritance-relations-values-lists-scope-that-is-n","errorCode":null,"errorMessage":"inheritance_relations values lists scope that is not in graph","messagePattern":"inheritance_relations values lists scope that is not in graph","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/eww/src/state/scope_graph.rs","lineNumber":539,"sourceCode":"                    bail!(\"inheritance_relations lists key that is not in graph\");\n                }\n                if let Some(parent_scope) = self.scopes.get(parent_scope_idx) {\n                    // check that everything the scope references from it's parent is actually\n                    // accessible by the parent, meaning it either stores it directly or\n                    // inherits it itself\n                    for var in &edge.references {\n                        let parent_has_access_to_var = parent_scope.data.contains_key(var)\n                            || self\n                                .inheritance_relations\n                                .child_to_parent\n                                .get(parent_scope_idx)\n                                .map_or(false, |(_, e)| e.references.contains(var));\n                        if !parent_has_access_to_var {\n                            bail!(\"scope inherited variable that parent scope doesn't have access to\");\n                        }\n                    }\n                } else {\n                    bail!(\"inheritance_relations values lists scope that is not in graph\");\n                }\n            }\n\n            self.hierarchy_relations.validate()?;\n            self.inheritance_relations.validate()?;\n\n            Ok(())\n        }\n\n        pub fn visualize(&self) -> String {\n            let mut output = String::new();\n            output.push_str(\"digraph {\\n\");\n\n            for (scope_index, scope) in &self.scopes {\n                output.push_str(&format!(\n                    \"  \\\"{:?}\\\"[label=\\\"{}\\\\n{}\\\"]\\n\",\n                    scope_index,\n                    scope.name,","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/elkowar/eww/blob/48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa/crates/eww/src/state/scope_graph.rs#L521-L557","documentation":"ScopeGraph::validate also verifies referential integrity: every scope index listed in inheritance_relations must exist in the graph. If an inheritance relation references a scope that was never added, validation bails with this error.","triggerScenarios":"A scope declares inheritance from a scope name/index that does not exist in the graph — typically referencing an undefined or removed scope in yuck, or an index mismatch when building the graph programmatically.","commonSituations":"Typos in :inherits scope names in yuck configs; deleting/renaming a scope but leaving stale references; programmatic graph construction inserting relations before adding the referenced scope.","solutions":["Fix the :inherits target so it names an existing (defscope ...) / defined scope","Remove stale inheritance references to deleted scopes","Order graph construction so scopes are inserted before relations referencing them","Run a lint/search over the config for the referenced scope name"],"exampleFix":";; before\n(defscope my-widget :inherits \"nonexistent-scope\")\n;; after\n(defscope base-scope ...)\n(defscope my-widget :inherits \"base-scope\")","handlingStrategy":"validation","validationCode":"const scopes = parseDefscopes(yuckSource);\nfor (const s of scopes) {\n  if (s.inherits && !scopes.some(x => x.name === s.inherits)) throw new Error(`unknown scope: ${s.inherits}`);\n}","typeGuard":"function scopeExists(name, graph) { return graph.scopes.has(name); }","tryCatchPattern":"try { eww.reload(); } catch (e) { if (String(e).includes('not in graph')) { console.error('An :inherits target references an undefined scope'); } else { throw e; } }","preventionTips":["Define all (defscope) targets before referencing them in :inherits","Grep the config for scope names after renames/deletions","Insert scopes before relations when building graphs programmatically","Keep one canonical place for scope definitions"],"tags":["yuck","config-validation","scope","reference"],"backgroundTag":"schema-validation-failed","analyzedSha":"48f5aa8b379adf29da0b0bb9ca04164f65d8bdaa","analyzedAt":"2026-09-08T03:13:26.897Z","contentChangedAt":"2026-09-08T03:13:26.897Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}