{"record":{"id":"2b50f8b3ebc7bbd9","repo":"GraphiteEditor/Graphite","slug":"path-node-does-not-exist-2b50f8","errorCode":null,"errorMessage":"Path node does not exist","messagePattern":"Path node does not exist","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"editor/src/messages/tool/tool_messages/spline_tool.rs","lineNumber":404,"sourceCode":"\n\t\t\t\tlet append_to_selected_layer = input.keyboard.key(append_to_selected);\n\n\t\t\t\t// Create new path in the selected layer when shift is down\n\t\t\t\tif let (Some(layer), true) = (selected_layer, append_to_selected_layer) {\n\t\t\t\t\ttool_data.current_layer = Some(layer);\n\n\t\t\t\t\tlet transform = document.metadata().transform_to_viewport(layer);\n\t\t\t\t\tlet position = transform.inverse().transform_point2(input.mouse.position);\n\t\t\t\t\ttool_data.next_point = position;\n\n\t\t\t\t\treturn SplineToolFsmState::Drawing;\n\t\t\t\t}\n\n\t\t\t\tresponses.add(DocumentMessage::DeselectAllLayers);\n\n\t\t\t\tlet parent = document.new_layer_bounding_artboard(input, viewport);\n\n\t\t\t\tlet path_node_type = resolve_network_node_type(\"Path\").expect(\"Path node does not exist\");\n\t\t\t\tlet path_node = path_node_type.default_node_template();\n\t\t\t\tlet spline_node_type = resolve_proto_node_type(graphene_std::vector::spline::IDENTIFIER).expect(\"Spline node does not exist\");\n\t\t\t\tlet spline_node = spline_node_type.node_template_input_override([Some(NodeInput::node(NodeId(1), 0))]);\n\t\t\t\tlet nodes = vec![(NodeId(1), path_node), (NodeId(0), spline_node)];\n\n\t\t\t\tlet layer = graph_modification_utils::new_custom(NodeId::new(), nodes, parent, responses);\n\t\t\t\ttool_options.drawing.fill.apply_fill(layer, responses);\n\t\t\t\ttool_options.drawing.apply_stroke_to_new_layer(layer, responses);\n\t\t\t\ttool_options.drawing.apply_stroke_order_to_new_layer(layer, responses);\n\t\t\t\ttool_data.current_layer = Some(layer);\n\t\t\t\ttool_data.new_layer_viewport_start = Some(viewport_vec);\n\n\t\t\t\t// Position the layer at the initial mouse position via Transform\n\t\t\t\tresponses.add(DeferMessage::AfterGraphRun {\n\t\t\t\t\tmessages: vec![translation_transform_set(document, layer, viewport_vec), NodeGraphMessage::RunDocumentGraph.into()],\n\t\t\t\t});\n\n\t\t\t\tSplineToolFsmState::Drawing","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/editor/src/messages/tool/tool_messages/spline_tool.rs#L386-L422","documentation":"Starting the first spline click creates a two-node layer (Path feeding a Spline node); the Path half is resolved by name via resolve_network_node_type(\"Path\").expect(\"Path node does not exist\") against the DOCUMENT_NODE_TYPES static registry. A miss means the structural Path node definition is missing or renamed in this build of the editor. The panic happens at spline-layer creation, before any spline geometry exists.","triggerScenarios":"Spline tool click that is not appending to an existing spline layer: after DeselectAllLayers and new_layer_bounding_artboard, the tool runs resolve_network_node_type(\"Path\").expect(...) and pairs it with the spline node in the new_custom call.","commonSituations":"The Path network node definition is renamed/removed in document_node_definitions.rs while spline_tool.rs (and freehand_tool.rs, pen_tool.rs) still pass the literal \"Path\"; divergent branches merging a registry refactor without updating all three call sites; forks renaming structural nodes for localization.","solutions":["Confirm the registry contains a Network definition keyed exactly \"Path\" (dump via collect_node_types()).","Introduce a single shared constant for the Path node name and use it at the definition site and in all tool call sites.","If the definition was renamed, add the node under the old key or update every resolve_network_node_type(\"Path\") occurrence in one change.","Degrade gracefully: use let-else to log and abort the spline start instead of crashing the editor."],"exampleFix":"// before\nlet path_node_type = resolve_network_node_type(\"Path\").expect(\"Path node does not exist\");\nlet path_node = path_node_type.default_node_template();\n\n// after\nlet Some(path_node) = resolve_network_node_type(PATH_NODE_NAME).map(|t| t.default_node_template()) else {\n\tlog::error!(\"Path network node missing; spline tool cannot create a layer\");\n\treturn SplineToolFsmState::Ready;\n};","handlingStrategy":"validation","validationCode":"let Some(path_node) = resolve_network_node_type(\"Path\").map(|t| t.default_node_template()) else {\n\t// Path node missing from registry: abort spline start gracefully\n\treturn SplineToolFsmState::Ready;\n};\nlet nodes = vec![(NodeId(1), path_node)];","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a shared constant for the Path node name at all creation sites.","Add a registry-consistency unit test listing every node name the tools resolve.","Review string-keyed lookups whenever the network node definition list is edited."],"tags":["rust","graphite-editor","node-registry","expect-panic","spline-tool","network-node","string-key"],"backgroundTag":"static-registry-lookup-failed","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}