{"record":{"id":"7b76b3be9c7049a9","repo":"swc-project/swc","slug":"failed-to-parse-meta","errorCode":null,"errorMessage":"failed to parse meta","messagePattern":"failed to parse meta","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_transforms_macros/src/parallel.rs","lineNumber":22,"sourceCode":"use syn::{parse_quote, Expr, Ident, ImplItem, ImplItemFn, ItemImpl, Meta, Type};\n\nuse crate::common::Mode;\n\npub fn expand(attr: TokenStream, mut item: ItemImpl) -> ItemImpl {\n    let mode = {\n        let p = &item.trait_.as_ref().unwrap().1;\n        if p.is_ident(\"Fold\") {\n            Mode::Fold\n        } else if p.is_ident(\"VisitMut\") {\n            Mode::VisitMut\n        } else {\n            unimplemented!(\"Unknown visitor type: {:?}\", p)\n        }\n    };\n    let meta = if attr.is_empty() {\n        None\n    } else {\n        Some(syn::parse2::<Meta>(attr).expect(\"failed to parse meta\"))\n    };\n    let explode = meta\n        .as_ref()\n        .map(|v| v.path().is_ident(\"explode\"))\n        .unwrap_or(false);\n\n    item.items.push(ImplItem::Fn(make_par_visit_method(\n        mode,\n        \"module_items\",\n        explode,\n    )));\n    item.items\n        .push(ImplItem::Fn(make_par_visit_method(mode, \"stmts\", explode)));\n\n    item\n}\n\nfn node_type(suffix: &str) -> Type {","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_transforms_macros/src/parallel.rs#L4-L40","documentation":"`#[parallel]` (swc_ecma_transforms_macros) accepts either an empty argument list or one syn `Meta` value, whose only recognized form is the path `explode`. When the attribute is non-empty, it is parsed with `syn::parse2::<Meta>` and this `expect(\"failed to parse meta\")` panics at compile time if the tokens are not a valid Meta (path, `name = value`, or parenthesized list).","triggerScenarios":"Writing `#[parallel(ParallelConfig { .. })]`, `#[parallel(explode =)]` (missing value), `#[parallel(\"explode\")]` (string literal), or any expression-style tokens instead of a bare path. Note `#[parallel(explode)]` is the intended usage; the macro only checks `path().is_ident(\"explode\")`.","commonSituations":"Contributors enabling parallel visitor processing on a `Fold`/`VisitMut` impl for a transform that should not recurse into child scopes, who try to pass a config struct or a key-value pair instead of the bare `explode` flag. Also note the macro only supports impls of exactly `Fold` or `VisitMut` (an adjacent `unimplemented!` fires otherwise).","solutions":["Use the bare form: `#[parallel]` for default behavior, `#[parallel(explode)]` to also emit the explode-style visit method.","Remove configuration objects, strings, and assignments from the attribute; it takes no key-value config.","Make sure the annotated item is an `impl Fold` or `impl VisitMut` block, not another trait."],"exampleFix":"// before\n#[parallel(explode = true)]\nimpl VisitMut for MyPass { /* ... */ }\n\n// after\n#[parallel(explode)]\nimpl VisitMut for MyPass { /* ... */ }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only `#[parallel]` or `#[parallel(explode)]` — the macro accepts no other form.","Do not attempt to pass config structs or key=value options; there is none.","Ensure the annotated block is an impl of Fold or VisitMut; other traits are rejected (unimplemented!)."],"tags":["proc-macro","attribute-argument","parallel","compile-time","swc"],"backgroundTag":"macro-attribute-argument-invalid","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"}