GraphiteEditor/Graphite · error
Fill node does not exist
Error message
Fill node does not exist
What it means
Panics when `resolve_proto_node_type(graphene_std::vector_nodes::fill::IDENTIFIER)` returns `None` in `insert_vector` (only when `include_fill` is true), which appends a Fill node to newly inserted vector geometry. The `fill` proto-node definition must exist in the static `DOCUMENT_NODE_TYPES` registry; the expect asserts that invariant at the last step of vector insertion.
Source
Thrown at editor/src/messages/portfolio/document/graph_operation/utility_types.rs:181
.expect("Transform node does not exist")
.default_node_template();
let transform_id = NodeId::new();
self.network_interface.insert_node(transform_id, transform, &[]);
self.network_interface.move_node_to_chain_start(&transform_id, layer, &[], self.import);
}
if include_stroke {
let stroke = resolve_proto_node_type(graphene_std::vector_nodes::stroke::IDENTIFIER)
.expect("Stroke node does not exist")
.default_node_template();
let stroke_id = NodeId::new();
self.network_interface.insert_node(stroke_id, stroke, &[]);
self.network_interface.move_node_to_chain_start(&stroke_id, layer, &[], self.import);
}
if include_fill {
let fill = resolve_proto_node_type(graphene_std::vector_nodes::fill::IDENTIFIER)
.expect("Fill node does not exist")
.default_node_template();
let fill_id = NodeId::new();
self.network_interface.insert_node(fill_id, fill, &[]);
self.network_interface.move_node_to_chain_start(&fill_id, layer, &[], self.import);
}
}
pub fn insert_text(&mut self, text: String, font: Font, typesetting: TypesettingConfig, layer: LayerNodeIdentifier) {
let font_resource_id = ResourceId::new();
let text = resolve_proto_node_type(graphene_std::text::text::IDENTIFIER)
.expect("Text node does not exist")
.node_template_input_override([
Some(NodeInput::value(TaggedValue::None, false)),
Some(NodeInput::value(TaggedValue::String(text), false)),
Some(NodeInput::value(TaggedValue::Resource(font_resource_id), false)),
Some(NodeInput::value(TaggedValue::F64(typesetting.font_size), false)),
Some(NodeInput::value(TaggedValue::F64(typesetting.line_height_ratio), false)),
Some(NodeInput::value(TaggedValue::F64(typesetting.letter_spacing), false)),View on GitHub (pinned to c507b35645)
Solutions
- Check the registry contains a definition for the `fill` IDENTIFIER.
- Repair the drift (restore the constant or re-add the entry).
- Handle `None` by logging and skipping the fill insertion only.
- Include this identifier in registry-completeness tests.
Example fix
// before
let fill = resolve_proto_node_type(graphene_std::vector_nodes::fill::IDENTIFIER)
.expect("Fill node does not exist")
.default_node_template();
// after
if let Some(fill_def) = resolve_proto_node_type(graphene_std::vector_nodes::fill::IDENTIFIER) {
let fill = fill_def.default_node_template();
let fill_id = NodeId::new();
self.network_interface.insert_node(fill_id, fill, &[]);
self.network_interface.move_node_to_chain_start(&fill_id, layer, &[], self.import);
} else {
log::error!("Fill proto node not registered; inserting vector without fill node");
} Defensive patterns
Strategy: validation
Validate before calling
// Before inserting filled vector geometry:
if document_node_definitions::resolve_proto_node_type(graphene_std::vector_nodes::fill::IDENTIFIER).is_none() {
log::error!("Fill node not registered; inserting without fill");
} Type guard
fn fill_node_registered() -> bool {
document_node_definitions::resolve_proto_node_type(graphene_std::vector_nodes::fill::IDENTIFIER).is_some()
} Try / catch
// Rust has no try/catch; degrade to inserting without the fill node:
if let Some(def) = resolve_proto_node_type(graphene_std::vector_nodes::fill::IDENTIFIER) {
// insert fill node
} else {
log::error!("Fill missing; vector inserted without fill");
} Prevention
- Include fill identifiers in registry tests
- Make optional nodes fail soft so geometry insertion still succeeds
- Register definitions atomically with node additions
- Use let-else over expect
When it happens
Trigger: Inserting vector geometry that has fill styling. Fires when the `vector_nodes::fill` IDENTIFIER resolves to no registry entry — renamed identifier, module reorganization, or a dropped/unregistered definition.
Common situations: Renaming the Fill node or its IDENTIFIER; moving nodes out of `graphene_std::vector_nodes`; registry-list omissions after adding or merging definitions.
Related errors
- Transform node does not exist
- Stroke node does not exist
- Solidify Stroke node should exist
- Boolean node does not exist
- Morph node does not exist
AI-assisted analysis of GraphiteEditor/Graphite@c507b35645 (2026-08-16).
Data as JSON: /api/errors/5ee2ee170b4f791e.
Report an issue: GitHub.