GraphiteEditor/Graphite · error

Star node can't be found

Error message

Star node can't be found

What it means

Star::create_node resolves the star vector generator proto node (graphene_std::vector::generator_nodes::star::IDENTIFIER) through the lazily-built DOCUMENT_NODE_TYPES registry and panics if the lookup returns None. This registry is a static HashMap populated by document_node_definitions(), so a miss means the identifier string in the graphene_std crate no longer matches any registered definition. It is a code-invariant expect, not a runtime data error: it only fires when the editor binary and the node registry disagree about the node's existence (rename, removal, or excluded build). The crash happens the moment the Star shape tool tries to spawn its layer.

Source

Thrown at editor/src/messages/tool/common_functionality/shapes/star_shape.rs:111

		if self.number_of_points_dial.is_dragging() || self.number_of_points_dial.is_hovering() {
			return Some(MouseCursorIcon::EWResize);
		}

		if self.point_radius_handle.is_dragging_or_snapped() || self.point_radius_handle.hovered() {
			return Some(MouseCursorIcon::Default);
		}

		None
	}
}

#[derive(Default)]
pub struct Star;

impl Star {
	pub fn create_node(vertices: u32) -> NodeTemplate {
		let identifier = DefinitionIdentifier::ProtoNode(graphene_std::vector::generator_nodes::star::IDENTIFIER);
		let node_type = resolve_document_node_type(&identifier).expect("Star node can't be found");
		node_type.node_template_input_override([
			None,
			Some(NodeInput::value(TaggedValue::U32(vertices), false)),
			Some(NodeInput::value(TaggedValue::F64(0.5), false)),
			Some(NodeInput::value(TaggedValue::F64(0.25), false)),
		])
	}

	pub fn update_shape(
		document: &DocumentMessageHandler,
		ipp: &InputPreprocessorMessageHandler,
		viewport: &ViewportMessageHandler,
		layer: LayerNodeIdentifier,
		shape_tool_data: &mut ShapeToolData,
		modifier: ShapeToolModifierKey,
		responses: &mut VecDeque<Message>,
	) {
		let [center, lock_ratio, _] = modifier;

View on GitHub (pinned to c507b35645)

Solutions

  1. Grep for the identifier: search for star::IDENTIFIER in graphene_std and confirm the exact string equals the key inserted into DOCUMENT_NODE_TYPES (compare against resolve_document_node_type output).
  2. Dump the registry at startup (collect_node_types() in document_node_definitions.rs) and check whether the star proto node key is present and spelled identically.
  3. If the node was renamed, update star::IDENTIFIER or add a registry alias rather than changing the tool to a hardcoded string.
  4. If the node was intentionally removed, replace the expect with a graceful path (log + return None / user-facing error) so the tool degrades instead of panicking.
  5. Verify no cargo feature or cfg gate excludes the vector generator module from the editor build.

Example fix

// before
let node_type = resolve_document_node_type(&identifier).expect("Star node can't be found");

// after
let node_type = resolve_document_node_type(&identifier)
	.unwrap_or_else(|| panic!("Star node '{identifier:?}' missing from DOCUMENT_NODE_TYPES; check registry keys"));
Defensive patterns

Strategy: validation

Validate before calling

// Run before creating the star layer
use editor::messages::portfolio::document::node_graph::document_node_definitions::resolve_document_node_type;
use graphene_std::vector::generator_nodes::star;

fn star_node_registered() -> bool {
	resolve_document_node_type(&DefinitionIdentifier::ProtoNode(star::IDENTIFIER.into())).is_some()
}

Prevention

When it happens

Trigger: Selecting or dragging with the Star shape tool, which calls Star::create_node(vertices) to build the node template via resolve_document_node_type(&DefinitionIdentifier::ProtoNode(star::IDENTIFIER)).expect(...). Also any startup or test code that constructs the star tool's node template directly.

Common situations: Renaming the star node's IDENTIFIER constant or its module path in graphene_std without updating this call site; removing the star generator from the registry list during a node-graph refactor; moving generator nodes behind a cargo feature that is not enabled in the editor build; copy-paste drift between an old branch and a restructured registry.

Related errors


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