GraphiteEditor/Graphite · error
Failed to create path node
Error message
Failed to create path node
What it means
The merge flow finishes by inserting a 'Path' node via resolve_network_node_type("Path").expect("Failed to create path node"). Identical failure mode to the Merge and Combine Paths lookups: DOCUMENT_NODE_TYPES has no DefinitionIdentifier::Network("Path") entry, so resolution returns None and the expect panics mid-merge, leaving the graph in a partially-modified state (the earlier MoveLayerToStack/InsertNode messages were already queued).
Source
Thrown at editor/src/messages/tool/common_functionality/graph_modification_utils.rs:120
// Add a Combine Paths node after the merge
let combine_paths_node_id = NodeId::new();
let combine_paths_node = document_node_definitions::resolve_proto_node_type(graphene_std::vector::combine_paths::IDENTIFIER)
.expect("Failed to create combine paths node")
.default_node_template();
responses.add(NodeGraphMessage::InsertNode {
node_id: combine_paths_node_id,
node_template: Box::new(combine_paths_node),
});
responses.add(NodeGraphMessage::MoveNodeToChainStart {
node_id: combine_paths_node_id,
parent: first_layer,
});
// Add a path node after the combine paths node
let path_node_id = NodeId::new();
let path_node = document_node_definitions::resolve_network_node_type("Path")
.expect("Failed to create path node")
.default_node_template();
responses.add(NodeGraphMessage::InsertNode {
node_id: path_node_id,
node_template: Box::new(path_node),
});
responses.add(NodeGraphMessage::MoveNodeToChainStart {
node_id: path_node_id,
parent: first_layer,
});
// Add a Spline node after the Path node if both the layers we are merging is spline.
if current_and_other_layer_is_spline {
let spline_node_id = NodeId::new();
let spline_node = document_node_definitions::resolve_proto_node_type(graphene_std::vector::spline::IDENTIFIER)
.expect("Failed to create Spline node")
.default_node_template();
responses.add(NodeGraphMessage::InsertNode {
node_id: spline_node_id,View on GitHub (pinned to c507b35645)
Solutions
- Sync the string literal with the registry identifier after renames (search for \"Path\" when touching node definitions)
- Replace the expect with a logged early-return so the merge aborts before mutating the graph further
- Cover all three identifiers used by merge_layers ('Merge', combine_paths::IDENTIFIER, 'Path') with a resolution unit test
Example fix
// before
let path_node = document_node_definitions::resolve_network_node_type("Path")
.expect("Failed to create path node")
.default_node_template();
// after
let Some(path_def) = document_node_definitions::resolve_network_node_type("Path") else {
log::error!("Path node definition missing from registry");
return;
};
let path_node = path_def.default_node_template(); Defensive patterns
Strategy: validation
Validate before calling
let Some(path_def) = document_node_definitions::resolve_network_node_type("Path") else {
log::error!("'Path' node definition missing from registry");
return;
}; Type guard
fn node_type_registered(identifier: &str) -> bool {
document_node_definitions::resolve_network_node_type(identifier).is_some()
} Prevention
- Keep a single list of built-in identifiers used by tooling and assert their resolvability in tests
- Abort multi-step graph edits before the first mutation if any required node type is unresolved
- When introducing feature-gated nodes, audit string-based lookups like 'Path' and 'Merge' for exclusion
When it happens
Trigger: Executing layer merge when the 'Path' network node identifier was renamed or excluded from the node registry in the current build.
Common situations: Registry refactors renaming Path (e.g., to a namespaced identifier) without updating this string; build configurations that omit basic path nodes.
Related errors
- Failed to create merge node
- Failed to create combine paths node
- Failed to create Spline node
- Failed to create transform node
- Solidify Stroke node should exist
AI-assisted analysis of GraphiteEditor/Graphite@c507b35645 (2026-08-16).
Data as JSON: /api/errors/1f9aa28dce1642cd.
Report an issue: GitHub.