{"record":{"id":"8a3e1afc9c5db01b","repo":"swc-project/swc","slug":"expected-at-least-one-name","errorCode":null,"errorMessage":"Expected at least one name","messagePattern":"Expected at least one name","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/util.rs","lineNumber":113,"sourceCode":"        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                }\n                _ => at_rule_prelude.map(Box::new),\n            },\n            Err(err) => {\n                if *err.kind() != ErrorKind::Ignore {\n                    self.errors.push(err);\n                }\n\n                if !list_of_component_values.children.is_empty() {\n                    Some(Box::new(AtRulePrelude::ListOfComponentValues(\n                        list_of_component_values,","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/util.rs#L95-L131","documentation":"Fired during @layer prelude canonicalization: the layer name list was empty even though the at-rule form requires at least one layer name (or a block-only '@layer { }' which is handled separately). The parser cannot attribute the rule to any layer and reports this error.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/util.rs:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide at least one layer name: '@layer name;' or '@layer name { ... }'","If an anonymous layer is intended, drop the prelude entirely: '@layer { ... }'"],"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-14T05:17:10.506Z"}