{"record":{"id":"c6d0ed1ce876c52c","repo":"GraphiteEditor/Graphite","slug":"failed-to-parse-node-fn-attributes-e","errorCode":null,"errorMessage":"Failed to parse node_fn attributes:\n{e}","messagePattern":"Failed to parse node_fn attributes:\n(.+?)","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"node-graph/node-macro/src/parsing.rs","lineNumber":591,"sourceCode":"\t\t}\n\n\t\tOk(NodeFnAttributes {\n\t\t\tcategory,\n\t\t\tdisplay_name,\n\t\t\tpath,\n\t\t\tskip_impl,\n\t\t\tproperties_string,\n\t\t\tcfg,\n\t\t\tshader_node,\n\t\t\tserialize,\n\t\t\tmemoize,\n\t\t\tinject_scope,\n\t\t})\n\t}\n}\n\npub(crate) fn parse_node_fn(attr: TokenStream2, item: TokenStream2) -> syn::Result<ParsedNodeFn> {\n\tlet attributes = syn::parse2::<NodeFnAttributes>(attr.clone()).map_err(|e| Error::new(e.span(), format!(\"Failed to parse node_fn attributes:\\n{e}\")))?;\n\tlet input_fn = syn::parse2::<ItemFn>(item.clone()).map_err(|e| Error::new(e.span(), format!(\"Failed to parse function: {e}. Make sure it's a valid Rust function.\")))?;\n\n\tlet vis = input_fn.vis;\n\tlet fn_name = input_fn.sig.ident.clone();\n\tlet struct_name = format_ident!(\"{}\", fn_name.to_string().to_case(Case::Pascal));\n\tlet mod_name = fn_name.clone();\n\tlet fn_generics = input_fn.sig.generics.params.into_iter().collect();\n\tlet is_async = input_fn.sig.asyncness.is_some();\n\n\tlet (input, fields) = parse_inputs(&input_fn.sig.inputs)?;\n\tlet output_type = parse_output(&input_fn.sig.output)?;\n\tlet output_element = peel_item(&output_type);\n\tlet where_clause = input_fn.sig.generics.where_clause;\n\tlet body = input_fn.block.to_token_stream();\n\tlet description = input_fn\n\t\t.attrs\n\t\t.iter()\n\t\t.filter_map(|a| {","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/node-graph/node-macro/src/parsing.rs#L573-L609","documentation":"Top-level wrapper for failures while parsing the #[node_macro::node(...)] attribute arguments (NodeFnAttributes). Every specific attribute problem — unsupported key, wrong literal shape, duplicate key, or the missing required category — bubbles up through this message with the inner error appended on the next line.","triggerScenarios":"An unknown attribute key (anything other than category, name, path, skip_impl, properties, cfg, shader_node, serialize, memoize, inject_scope); wrong argument shapes like name(Value) without quotes or skip_impl(true) instead of the bare flag; the same key given twice; omitting the required category(...) entirely.","commonSituations":"Typos in attribute names (e.g. categry(\"Value\")); copying example code whose keys changed across a macro version bump; IDE autocompletion inserting parentheses where a path-only flag is expected.","solutions":["Read the appended inner error — it names the real problem (e.g. \"Unsupported attribute in `node`\" or \"The attribute 'category' is required\")","Restrict keys to the supported list with documented shapes: category(\"Value\"), name(\"X\"), path(core::T), properties(\"fn_name\"), shader_node(T), serialize(path), cfg(...), and bare flags skip_impl, memoize, inject_scope","Always include category(...) — category(\"\") is valid when a node should be hidden from the catalog"],"exampleFix":"// before: missing the required category(...)\n#[node_macro::node(name(\"My Node\"))]\nfn my_node(...) -> ... { /* ... */ }\n\n// after\n#[node_macro::node(category(\"Value\"), name(\"My Node\"))]\nfn my_node(...) -> ... { /* ... */ }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Start from a working node's attribute block and modify it incrementally","category(...) is mandatory — add it first; category(\"\") hides the node","Use only the supported keys: category, name, path, skip_impl, properties, cfg, shader_node, serialize, memoize, inject_scope"],"tags":["proc-macro","rust","node-graph","attributes","compile-time"],"backgroundTag":"proc-macro-syntax-error","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}