{"record":{"id":"de36380f6cbcf0ed","repo":"GraphiteEditor/Graphite","slug":"arrow-node-can-t-be-found","errorCode":null,"errorMessage":"Arrow node can't be found","messagePattern":"Arrow node can't be found","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"editor/src/messages/tool/common_functionality/shapes/arrow_shape.rs","lineNumber":25,"sourceCode":"use crate::messages::portfolio::document::overlays::utility_types::OverlayContext;\nuse crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;\nuse crate::messages::portfolio::document::utility_types::network_interface::{InputConnector, NodeTemplate};\nuse crate::messages::prelude::*;\nuse crate::messages::tool::common_functionality::graph_modification_utils;\npub use crate::messages::tool::common_functionality::graph_modification_utils::NodeGraphLayer;\nuse crate::messages::tool::common_functionality::snapping::SnapData;\nuse glam::{DAffine2, DVec2};\nuse graph_craft::document::NodeInput;\nuse graph_craft::document::value::TaggedValue;\nuse std::collections::VecDeque;\n\n#[derive(Default)]\npub struct Arrow;\n\nimpl Arrow {\n\tpub fn create_node(shaft_width: f64, head_width: f64, head_length: f64) -> NodeTemplate {\n\t\tlet identifier = DefinitionIdentifier::ProtoNode(graphene_std::vector_nodes::arrow::IDENTIFIER);\n\t\tlet node_type = resolve_document_node_type(&identifier).expect(\"Arrow node can't be found\");\n\t\tnode_type.node_template_input_override([\n\t\t\tNone,\n\t\t\tSome(NodeInput::value(TaggedValue::DVec2(DVec2::ZERO), false)), // arrow_to\n\t\t\tSome(NodeInput::value(TaggedValue::F64(shaft_width), false)),   // shaft_width\n\t\t\tSome(NodeInput::value(TaggedValue::F64(head_width), false)),    // head_width\n\t\t\tSome(NodeInput::value(TaggedValue::F64(head_length), false)),   // head_length\n\t\t])\n\t}\n\n\tpub fn update_shape(\n\t\tdocument: &DocumentMessageHandler,\n\t\tinput: &InputPreprocessorMessageHandler,\n\t\tviewport: &ViewportMessageHandler,\n\t\tlayer: LayerNodeIdentifier,\n\t\ttool_data: &mut ShapeToolData,\n\t\tmodifier: ShapeToolModifierKey,\n\t\tresponses: &mut VecDeque<Message>,\n\t) {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/editor/src/messages/tool/common_functionality/shapes/arrow_shape.rs#L7-L43","documentation":"Arrow::create_node builds a DefinitionIdentifier::ProtoNode for graphene_std::vector_nodes::arrow::IDENTIFIER, resolves it via resolve_document_node_type (document_node_definitions.rs:1484 — a HashMap::get on the static DOCUMENT_NODE_TYPES), and unwraps with .expect(\"Arrow node can't be found\") (arrow_shape.rs:25). The panic means the Arrow proto node is not registered in document_node_definitions(); it is a build/registration defect triggered the moment the Arrow tool tries to create its layer.","triggerScenarios":"Selecting the Arrow tool and dragging to draw while vector_nodes::arrow::IDENTIFIER is absent from DOCUMENT_NODE_TYPES — node renamed, deleted, or its registration entry dropped.","commonSituations":"Refactors of the vector_nodes crate that move Arrow to a different module path; version upgrades reorganizing proto vs network nodes; local forks disabling arrow support without removing the tool.","solutions":["Verify the arrow identifier appears as a key in DOCUMENT_NODE_TYPES (grep the identifier string in document_node_definitions.rs)","Re-align the IDENTIFIER const and the registration key, then rebuild","Return Option<NodeTemplate> from create_node and have the tool skip layer creation with a log when None","Add a registry test enumerating every shape-tool identifier (Arrow, Circle, Ellipse, Line, Polygon, Rectangle, Spiral, Arc, Grid)"],"exampleFix":"// before\nlet node_type = resolve_document_node_type(&identifier).expect(\"Arrow node can't be found\");\n// after\nlet Some(node_type) = resolve_document_node_type(&identifier) else {\n\tlog::error!(\"Arrow node definition missing; cannot create arrow layer\");\n\treturn None;\n};","handlingStrategy":"validation","validationCode":"fn arrow_node_available() -> bool {\n\tlet identifier = DefinitionIdentifier::ProtoNode(graphene_std::vector_nodes::arrow::IDENTIFIER);\n\tdocument_node_definitions::resolve_document_node_type(&identifier).is_some()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check registry membership in tests for every node a tool inserts","After moving a node between modules (vector vs vector_nodes), update DefinitionIdentifier references the same commit","Keep input-override arrays in create_node aligned with the node's declared inputs"],"tags":["rust","graphite","panic","expect","node-registry","arrow-tool"],"backgroundTag":"node-definition-not-found","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}