{"record":{"id":"b01833f64abeb2d7","repo":"GraphiteEditor/Graphite","slug":"not-enough-arguments-provided-to-construct-node","errorCode":null,"errorMessage":"Not enough arguments provided to construct node","messagePattern":"Not enough arguments provided to construct node","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"node-graph/interpreted-executor/src/node_registry.rs","lineNumber":641,"sourceCode":"mod node_registry_macros {\n\tmacro_rules! async_node {\n\t\t// TODO: we currently need to annotate the type here because the compiler would otherwise (correctly)\n\t\t// TODO: assign a Pin<Box<dyn Future<Output=T>>> type to the node, which is not what we want for now.\n\t\t//\n\t\t// This `params` variant of the macro wraps the normal `fn_params` variant and is used as a shorthand for writing `T` instead of `() => T`\n\t\t($path:ty, input: $input:ty, params: [$($type:ty),*]) => {\n\t\t\tasync_node!($path, input: $input, fn_params: [ $(() => $type),*])\n\t\t};\n\t\t($path:ty, input: $input:ty, fn_params: [$($arg:ty => $type:ty),*]) => {\n\t\t\tasync_node!(identifier: ProtoNodeIdentifier::new(stringify!($path)), $path, input: $input, fn_params: [$($arg => $type),*])\n\t\t};\n\t\t(identifier: $identifier:expr, $path:ty, input: $input:ty, fn_params: [$($arg:ty => $type:ty),*]) => {\n\t\t\t(\n\t\t\t\t$identifier,\n\t\t\t\t|mut args| {\n\t\t\t\t\tBox::pin(async move {\n\t\t\t\t\t\targs.reverse();\n\t\t\t\t\t\tlet node = <$path>::new($(graphene_std::any::downcast_node::<$arg, $type>(args.pop().expect(\"Not enough arguments provided to construct node\"))),*);\n\t\t\t\t\t\tlet any: DynAnyNode<$input, _, _> = graphene_std::any::DynAnyNode::new(node);\n\t\t\t\t\t\tBox::new(any) as TypeErasedBox\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlet node = <$path>::new($(\n\t\t\t\t\t\tgraphene_std::any::PanicNode::<$arg, core::pin::Pin<Box<dyn core::future::Future<Output = $type> + Send>>>::new()\n\t\t\t\t\t),*);\n\t\t\t\t\tlet params = vec![$(fn_type_fut!($arg, $type)),*];\n\t\t\t\t\tlet mut node_io = NodeIO::<'_, $input>::to_async_node_io(&node, params);\n\t\t\t\t\tnode_io.call_argument = concrete!(<$input as StaticType>::Static);\n\t\t\t\t\tnode_io\n\t\t\t\t},\n\t\t\t)\n\t\t};\n\t}\n\n\tpub(crate) use async_node;","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/node-graph/interpreted-executor/src/node_registry.rs#L623-L659","documentation":"The async_node! macro generates a constructor closure that pops one argument per declared fn_params entry; when the runtime supplies fewer arguments than the node's signature declares, args.pop() returns None and this panic fires inside the generated closure.","triggerScenarios":"Executing a node whose proto-network inputs deliver fewer values than its fn_params list — an input that produced no argument, or a node whose signature gained parameters after the graph was serialized.","commonSituations":"Adding parameters to a node without updating saved graphs or test wiring; mixed versions of the node registry and documents; hand-built proto networks in tests.","solutions":["Compare the node's fn_params list against the inputs actually connected for that node in the proto network","Re-save or rebuild the document against the current node registry","In tests, assert the argument count equals the node's NodeIO params length before invoking the executor"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// in tests, verify wiring matches the node signature before executing\n// let params = node_io.params.len();\n// assert_eq!(provided_args, params, \"argument count must match fn_params\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When changing a node's fn_params, bump and migrate document formats accordingly","Run the node registry test suite after any signature change","Never hand-wire proto networks without checking every declared param is fed"],"tags":["node-registry","macro","executor","arity-mismatch"],"backgroundTag":"node-argument-arity-mismatch","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}