{"record":{"id":"3cd79b54f8a338c2","repo":"swc-project/swc","slug":"expected-only-one-name","errorCode":null,"errorMessage":"Expected only one name","messagePattern":"Expected only one name","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/util.rs","lineNumber":103,"sourceCode":"                }\n                _ => {\n                    unreachable!();\n                }\n            },\n            _ => {\n                unreachable!();\n            }\n        };\n\n        at_rule.prelude = match self\n            .parse_according_to_grammar(&list_of_component_values, |parser| {\n                parser.parse_at_rule_prelude(&normalized_at_rule_name)\n            }) {\n            Ok(at_rule_prelude) => match at_rule_prelude {\n                Some(AtRulePrelude::LayerPrelude(LayerPrelude::NameList(name_list)))\n                    if name_list.name_list.len() > 1 && at_rule.block.is_some() =>\n                {\n                    self.errors.push(Error::new(\n                        name_list.span,\n                        ErrorKind::Expected(\"only one name\"),\n                    ));\n\n                    Some(Box::new(AtRulePrelude::ListOfComponentValues(\n                        list_of_component_values,\n                    )))\n                }\n                None if normalized_at_rule_name == \"layer\" && at_rule.block.is_none() => {\n                    self.errors.push(Error::new(\n                        at_rule.span,\n                        ErrorKind::Expected(\"at least one name\"),\n                    ));\n\n                    Some(Box::new(AtRulePrelude::ListOfComponentValues(\n                        list_of_component_values,\n                    )))\n                }","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/util.rs#L85-L121","documentation":"Fired during @layer at-rule prelude canonicalization: a layer name list contained more than one name while the at-rule has a block, i.e. '@layer a, b { ... }'. The spec's @layer block form allows only a single layer name, so the parser reports this error on the name-list span.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/util.rs:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a single layer name in the block form: '@layer a { ... }'","Move extra names into separate '@layer name;' statements without a block"],"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"}