{"record":{"id":"c79b937a0637e48e","repo":"GraphiteEditor/Graphite","slug":"star-node-can-t-be-found","errorCode":null,"errorMessage":"Star node can't be found","messagePattern":"Star node can't be found","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"editor/src/messages/tool/common_functionality/shapes/star_shape.rs","lineNumber":111,"sourceCode":"\t\tif self.number_of_points_dial.is_dragging() || self.number_of_points_dial.is_hovering() {\n\t\t\treturn Some(MouseCursorIcon::EWResize);\n\t\t}\n\n\t\tif self.point_radius_handle.is_dragging_or_snapped() || self.point_radius_handle.hovered() {\n\t\t\treturn Some(MouseCursorIcon::Default);\n\t\t}\n\n\t\tNone\n\t}\n}\n\n#[derive(Default)]\npub struct Star;\n\nimpl Star {\n\tpub fn create_node(vertices: u32) -> NodeTemplate {\n\t\tlet identifier = DefinitionIdentifier::ProtoNode(graphene_std::vector::generator_nodes::star::IDENTIFIER);\n\t\tlet node_type = resolve_document_node_type(&identifier).expect(\"Star node can't be found\");\n\t\tnode_type.node_template_input_override([\n\t\t\tNone,\n\t\t\tSome(NodeInput::value(TaggedValue::U32(vertices), false)),\n\t\t\tSome(NodeInput::value(TaggedValue::F64(0.5), false)),\n\t\t\tSome(NodeInput::value(TaggedValue::F64(0.25), false)),\n\t\t])\n\t}\n\n\tpub fn update_shape(\n\t\tdocument: &DocumentMessageHandler,\n\t\tipp: &InputPreprocessorMessageHandler,\n\t\tviewport: &ViewportMessageHandler,\n\t\tlayer: LayerNodeIdentifier,\n\t\tshape_tool_data: &mut ShapeToolData,\n\t\tmodifier: ShapeToolModifierKey,\n\t\tresponses: &mut VecDeque<Message>,\n\t) {\n\t\tlet [center, lock_ratio, _] = modifier;","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/editor/src/messages/tool/common_functionality/shapes/star_shape.rs#L93-L129","documentation":"Star::create_node resolves the star vector generator proto node (graphene_std::vector::generator_nodes::star::IDENTIFIER) through the lazily-built DOCUMENT_NODE_TYPES registry and panics if the lookup returns None. This registry is a static HashMap populated by document_node_definitions(), so a miss means the identifier string in the graphene_std crate no longer matches any registered definition. It is a code-invariant expect, not a runtime data error: it only fires when the editor binary and the node registry disagree about the node's existence (rename, removal, or excluded build). The crash happens the moment the Star shape tool tries to spawn its layer.","triggerScenarios":"Selecting or dragging with the Star shape tool, which calls Star::create_node(vertices) to build the node template via resolve_document_node_type(&DefinitionIdentifier::ProtoNode(star::IDENTIFIER)).expect(...). Also any startup or test code that constructs the star tool's node template directly.","commonSituations":"Renaming the star node's IDENTIFIER constant or its module path in graphene_std without updating this call site; removing the star generator from the registry list during a node-graph refactor; moving generator nodes behind a cargo feature that is not enabled in the editor build; copy-paste drift between an old branch and a restructured registry.","solutions":["Grep for the identifier: search for star::IDENTIFIER in graphene_std and confirm the exact string equals the key inserted into DOCUMENT_NODE_TYPES (compare against resolve_document_node_type output).","Dump the registry at startup (collect_node_types() in document_node_definitions.rs) and check whether the star proto node key is present and spelled identically.","If the node was renamed, update star::IDENTIFIER or add a registry alias rather than changing the tool to a hardcoded string.","If the node was intentionally removed, replace the expect with a graceful path (log + return None / user-facing error) so the tool degrades instead of panicking.","Verify no cargo feature or cfg gate excludes the vector generator module from the editor build."],"exampleFix":"// before\nlet node_type = resolve_document_node_type(&identifier).expect(\"Star node can't be found\");\n\n// after\nlet node_type = resolve_document_node_type(&identifier)\n\t.unwrap_or_else(|| panic!(\"Star node '{identifier:?}' missing from DOCUMENT_NODE_TYPES; check registry keys\"));","handlingStrategy":"validation","validationCode":"// Run before creating the star layer\nuse editor::messages::portfolio::document::node_graph::document_node_definitions::resolve_document_node_type;\nuse graphene_std::vector::generator_nodes::star;\n\nfn star_node_registered() -> bool {\n\tresolve_document_node_type(&DefinitionIdentifier::ProtoNode(star::IDENTIFIER.into())).is_some()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reference node identifiers via their defining crate's IDENTIFIER constant instead of string literals so renames surface at compile time.","After any registry refactor, run the editor and cycle every shape tool once (star included) in a smoke test.","Add a startup self-test asserting all tool-required node identifiers resolve (star, brush, spline, Path)."],"tags":["rust","graphite-editor","node-registry","expect-panic","shape-tool","static-registry"],"backgroundTag":"static-registry-lookup-failed","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}