{"record":{"id":"0847bd474896c592","repo":"GraphiteEditor/Graphite","slug":"path-node-does-not-exist-0847bd","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/pen_tool.rs","lineNumber":1350,"sourceCode":"\t\t\tif let Some(layer) = existing_layer {\n\t\t\t\t// Add point to existing layer\n\t\t\t\tresponses.add(PenToolMessage::AddPointLayerPosition { layer, viewport: viewport_vec });\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif let Some((layer, point, _position)) = closest_point(document, viewport_vec, tolerance, document.metadata().all_layers(), |_| false) {\n\t\t\tlet vector = document.network_interface.compute_modified_vector(layer).unwrap();\n\t\t\tlet segment = vector.all_connected(point).collect::<Vec<_>>().first().map(|s| s.segment);\n\t\t\tself.handle_mode = HandleMode::Free;\n\t\t\tif self.modifiers.lock_angle {\n\t\t\t\tself.set_lock_angle(&vector, point, segment);\n\t\t\t\tself.switch_to_free_on_ctrl_release = true;\n\t\t\t}\n\t\t}\n\n\t\t// New path layer\n\t\tlet node_type = resolve_network_node_type(\"Path\").expect(\"Path node does not exist\");\n\t\tlet nodes = vec![(NodeId(0), node_type.default_node_template())];\n\n\t\tlet parent = document.new_layer_bounding_artboard(input, viewport);\n\t\tlet layer = graph_modification_utils::new_custom(NodeId::new(), nodes, parent, responses);\n\t\tself.current_layer = Some(layer);\n\t\ttool_options.drawing.fill.apply_fill(layer, responses);\n\t\ttool_options.drawing.apply_stroke_to_new_layer(layer, responses);\n\t\ttool_options.drawing.apply_stroke_order_to_new_layer(layer, responses);\n\t\tself.prior_segment = None;\n\t\tself.prior_segments = None;\n\t\tresponses.add(NodeGraphMessage::SelectedNodesSet { nodes: vec![layer.to_node()] });\n\n\t\t// Set up the first point at local origin (0,0) and position the layer at the viewport location via Transform\n\t\tlet id = PointId::generate();\n\t\tself.add_point(LastPoint {\n\t\t\tid,\n\t\t\tpos: DVec2::ZERO,\n\t\t\tin_segment: None,","sourceCodeStart":1332,"sourceCodeEnd":1368,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/editor/src/messages/tool/tool_messages/pen_tool.rs#L1332-L1368","documentation":"process_tool_data for the pen tool pre-creates a new Path layer so the next click can extend it, resolving the built-in 'Path' network node by name with resolve_network_node_type(\"Path\").expect(...). The lookup goes through the DOCUMENT_NODE_TYPES static registry keyed by DefinitionIdentifier::Network(\"Path\"); a miss means the structural Path node definition is absent or renamed in this build. The panic strikes as soon as the pen tool is used to start a new path, at layer creation time.","triggerScenarios":"Activating the pen tool and clicking to begin a path (the tool-data processing step after the closest-point snapping check), which runs resolve_network_node_type(\"Path\").expect(\"Path node does not exist\") and feeds the default template into graph_modification_utils::new_custom.","commonSituations":"The Path network node definition was renamed or removed in document_node_definitions.rs during refactoring while freehand_tool.rs, pen_tool.rs, and spline_tool.rs keep literal \"Path\" strings; localization passes changing node display/registry names; forks that restructured structural nodes without a compatibility alias.","solutions":["Verify a Network definition named exactly \"Path\" exists in the registry (inspect collect_node_types() output).","Centralize the name in one constant shared by the definition site and the three tool call sites to eliminate literal drift.","If the node was renamed, re-add it under the old key or update all call sites in the same commit (search resolve_network_node_type(\"Path\") across the repo).","Convert the expect into an early-return with an error log if pen-tool path creation should degrade gracefully on exotic builds."],"exampleFix":"// before\nlet node_type = resolve_network_node_type(\"Path\").expect(\"Path node does not exist\");\nlet nodes = vec![(NodeId(0), node_type.default_node_template())];\n\n// after\nlet Some(node_type) = resolve_network_node_type(PATH_NODE_NAME) else {\n\tlog::error!(\"Path network node missing from registry; pen tool cannot start a path\");\n\treturn;\n};\nlet nodes = vec![(NodeId(0), node_type.default_node_template())];","handlingStrategy":"validation","validationCode":"if let Some(node_type) = resolve_network_node_type(\"Path\") {\n\tlet nodes = vec![(NodeId(0), node_type.default_node_template())];\n\t// create the pen layer\n} else {\n\t// registry drift: log and disable pen tool start\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Share one constant for the Path node name across pen/freehand/spline tools and the definition site.","Rename node definitions and their string consumers in a single commit; grep for the old literal in CI via a banned-strings list if needed.","Smoke-test each vector drawing tool (pen, freehand, spline) after registry changes."],"tags":["rust","graphite-editor","node-registry","expect-panic","pen-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"}