GraphiteEditor/Graphite · error

Node

Error message

Node

What it means

Panics when `resolve_network_node_type("Artboard")` returns `None` in `create_artboard`. The Artboard network-node definition must exist in the static `DOCUMENT_NODE_TYPES` registry under the exact key `"Artboard"`; `create_artboard` then overrides its template inputs (Artboard/Graphic types, location, dimensions, background, clip). The bare `expect("Node")` is a registry-presence assertion for that key.

Source

Thrown at editor/src/messages/portfolio/document/graph_operation/utility_types.rs:73

		if layer == LayerNodeIdentifier::ROOT_PARENT {
			log::error!("LayerNodeIdentifier::ROOT_PARENT should not be used in ModifyInputsContext::new_with_layer");
			return None;
		}
		let mut document = Self::new(network_interface, responses);
		document.layer_node = Some(layer);
		Some(document)
	}

	/// Creates a new layer and adds it to the document network. network_interface.move_layer_to_stack should be called after
	pub fn create_layer(&mut self, new_id: NodeId) -> LayerNodeIdentifier {
		let new_merge_node = resolve_network_node_type("Merge").expect("Merge node").default_node_template();
		self.network_interface.insert_node(new_id, new_merge_node, &[]);
		LayerNodeIdentifier::new(new_id, self.network_interface)
	}

	/// Creates an artboard as the primary export for the document network.
	pub fn create_artboard(&mut self, new_id: NodeId, location: DVec2, dimensions: DVec2, background: Color, clip: bool) -> LayerNodeIdentifier {
		let artboard_node_template = resolve_network_node_type("Artboard").expect("Node").node_template_input_override([
			Some(NodeInput::type_default(list!(Artboard), true)),
			Some(NodeInput::type_default(list!(Graphic), true)),
			Some(NodeInput::value(TaggedValue::DVec2(location), false)),
			Some(NodeInput::value(TaggedValue::DVec2(dimensions), false)),
			Some(NodeInput::value(TaggedValue::Color(background), false)),
			Some(NodeInput::value(TaggedValue::Bool(clip), false)),
		]);
		self.network_interface.insert_node(new_id, artboard_node_template, &[]);
		LayerNodeIdentifier::new(new_id, self.network_interface)
	}

	pub fn insert_boolean_data(&mut self, operation: graphene_std::vector::misc::BooleanOperation, layer: LayerNodeIdentifier) {
		let boolean = resolve_proto_node_type(graphene_std::path_bool_nodes::boolean_operation::IDENTIFIER)
			.expect("Boolean node does not exist")
			.node_template_input_override([
				Some(NodeInput::type_default(list!(Graphic), true)),
				Some(NodeInput::value(TaggedValue::BooleanOperation(operation), false)),
			]);

View on GitHub (pinned to c507b35645)

Solutions

  1. Confirm the `"Artboard"` key exists in `DOCUMENT_NODE_TYPES`; re-add the `DocumentNodeDefinition` if a refactor removed it.
  2. If renamed, update the key here or leave an alias so `resolve_network_node_type("Artboard")` keeps resolving.
  3. Handle the `None` case: log `"Artboard node definition missing"` and return without inserting a malformed node.
  4. Improve the message from `"Node"` to something diagnosable (`"Artboard node definition not registered"`).

Example fix

// before
let artboard_node_template = resolve_network_node_type("Artboard").expect("Node").node_template_input_override([

// after
let Some(artboard_def) = resolve_network_node_type("Artboard") else {
    log::error!("Artboard node definition not registered; cannot create artboard");
    return LayerNodeIdentifier::ROOT_PARENT;
};
let artboard_node_template = artboard_def.node_template_input_override([
Defensive patterns

Strategy: validation

Validate before calling

// Before calling create_artboard:
if document_node_definitions::resolve_network_node_type("Artboard").is_none() {
    log::error!("Artboard node definition missing; aborting");
    return;
}

Type guard

fn artboard_definition_available() -> bool {
    document_node_definitions::resolve_network_node_type("Artboard").is_some()
}

Try / catch

// Rust has no try/catch; branch on the Option:
let Some(artboard_def) = resolve_network_node_type("Artboard") else {
    log::error!("Artboard definition missing");
    return LayerNodeIdentifier::ROOT_PARENT;
};

Prevention

When it happens

Trigger: Creating an artboard via `GraphOperationMessage` (artboard tool, document setup for a new file, import flows). Fires only when the `"Artboard"` key is missing from the registry — renamed key, deleted definition, or a registry-generating macro that skipped it.

Common situations: Renaming the Artboard registry key during a definitions refactor; a rebase that dropped the definition entry; conditionally-compiled definitions where the artboard entry sits behind a disabled feature.

Related errors


AI-assisted analysis of GraphiteEditor/Graphite@c507b35645 (2026-08-16). Data as JSON: /api/errors/1e2a921f9ab285b3. Report an issue: GitHub.