{"record":{"id":"73e4561d09db86ba","repo":"neon-bindings/neon","slug":"unknown-class-attribute","errorCode":null,"errorMessage":"Unknown class attribute '{}'","messagePattern":"Unknown class attribute '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/neon-macros/src/export/class/meta.rs","lineNumber":41,"sourceCode":"        let mut meta = Meta::default();\n\n        // Check for parenthesized attributes: class(name = \"...\")\n        if input.peek(syn::token::Paren) {\n            let content;\n            syn::parenthesized!(content in input);\n\n            // Parse attributes inside parentheses\n            while !content.is_empty() {\n                let name_token: syn::Ident = content.parse()?;\n\n                match name_token.to_string().as_str() {\n                    \"name\" => {\n                        content.parse::<syn::Token![=]>()?;\n                        let name_value: syn::LitStr = content.parse()?;\n                        meta.class_name = Some(name_value.value());\n                    }\n                    _ => {\n                        return Err(syn::Error::new(\n                            name_token.span(),\n                            format!(\"Unknown class attribute '{}'\", name_token),\n                        ));\n                    }\n                }\n\n                // Parse optional comma\n                if content.parse::<syn::Token![,]>().is_err() {\n                    break;\n                }\n            }\n        }\n\n        // Check if there are additional attributes after \"class\" or \"class(...)\"\n        if input.parse::<syn::Token![,]>().is_ok() {\n            // Parse additional attributes like name = \"...\"\n            while !input.is_empty() {\n                let name_token: syn::Ident = input.parse()?;","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/neon-bindings/neon/blob/38960e4381d9ad13b551cdf2d261f609167c9bc2/crates/neon-macros/src/export/class/meta.rs#L23-L59","documentation":"This is a compile-time error from Neon's `#[neon]` macro when parsing the attribute list inside `export(class(...))`. The macro only recognizes `name` as a valid attribute inside the parentheses; any other identifier is rejected. It ensures typo'd or unsupported class options fail fast instead of being silently ignored.","triggerScenarios":"Writing `#[neon] export(class(rename = \"Foo\"))` or any attribute key other than `name` inside the `class(...)` parentheses of the export attribute, e.g. `export(class(fname = \"X\"))`.","commonSituations":"Developers guessing at attribute names (e.g. `class_name`, `rename`, `jsName`) based on other macro systems, copying patterns from `export(fn)` attributes, or upgrading Neon versions where an attribute may have been renamed or removed.","solutions":["Replace the unknown attribute with `name`: `export(class(name = \"ClassName\"))`.","Check the Neon docs for the exact set of supported `class` attributes (only `name` is currently accepted).","If you intended to rename the module export binding rather than the class itself, move the `name = \"...\"` attribute outside the parentheses: `export(class, name = \"binding\")`."],"exampleFix":"// before\n#[neon]\nexport(class(rename = \"MyClass\"))\n// after\n#[neon]\nexport(class(name = \"MyClass\"))","handlingStrategy":"validation","validationCode":"// Only `name` is a valid attribute inside export(class(...)):\n// verify every key you write in class(...) is exactly `name`:\n// #[neon] export(class(name = \"...\"))\nconst VALID_CLASS_ATTRS: [&str; 1] = [\"name\"];\nfn check_attr(attr: &str) -> Result<(), String> {\n    if VALID_CLASS_ATTRS.contains(&attr) { Ok(()) } else { Err(format!(\"Unknown class attribute '{}'\", attr)) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only documented attributes; inside class(...) the sole supported key is `name`.","Copy attribute syntax from official Neon examples rather than other macro frameworks.","Run `cargo check` after editing attribute macros to catch parse errors early."],"tags":["rust","proc-macro","neon","attribute-parsing"],"backgroundTag":"invalid-config-value","analyzedSha":"38960e4381d9ad13b551cdf2d261f609167c9bc2","analyzedAt":"2026-09-13T09:05:33.640Z","contentChangedAt":"2026-09-13T09:05:33.640Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}