{"record":{"id":"a112be28e2fabd79","repo":"swc-project/swc","slug":"failed-to-parse-args-of-ast-node","errorCode":null,"errorMessage":"failed to parse args of #[ast_node]","messagePattern":"failed to parse args of #\\[ast_node\\]","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ast_node/src/lib.rs","lineNumber":260,"sourceCode":"                )]\n                #clone\n                #non_exhaustive\n                #[cfg_attr(\n                    feature = \"serde-impl\",\n                    serde(untagged)\n                )]\n                #[cfg_attr(\n                    feature = \"encoding-impl\",\n                    derive(::swc_common::Encode, ::swc_common::Decode)\n                )]\n                #input\n            ));\n        }\n        _ => {\n            let args: Option<ast_node_macro::Args> = if args.is_empty() {\n                None\n            } else {\n                Some(parse(args).expect(\"failed to parse args of #[ast_node]\"))\n            };\n\n            let serde_tag = match input.data {\n                Data::Struct(DataStruct {\n                    fields: Fields::Named(..),\n                    ..\n                }) => {\n                    if args.is_some() {\n                        Some(quote!(#[cfg_attr(\n                            feature = \"serde-impl\",\n                            serde(tag = \"type\")\n                        )]))\n                    } else {\n                        None\n                    }\n                }\n                _ => None,\n            };","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/ast_node/src/lib.rs#L242-L278","documentation":"On the non-enum arm of #[ast_node] (structs/unions), the attribute arguments failed to parse into ast_node_macro::Args. This fires when the payload after the node tag uses an unknown or malformed option — the expected forms are a quoted tag like #[ast_node(\"Ident\")] plus recognized flags such as no_partial_eq; anything else fails at compile time.","triggerScenarios":"Thrown at crates/ast_node/src/lib.rs:260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the arguments match the documented grammar, e.g. #[ast_node(\"Tag\", no_partial_eq)]","Remove unsupported options and check crate docs for the accepted flag list","For enums, drop arguments entirely — the enum arm rejects them with its own message"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}