{"record":{"id":"498c79e9b6441523","repo":"swc-project/swc","slug":"expected-ident-at-first-position-in-general-enclo","errorCode":null,"errorMessage":"Expected ident at first position in <general-enclosed>","messagePattern":"Expected ident at first position in <general-enclosed>","errorType":"validation","errorClass":"swc_css_parser::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/at_rules/mod.rs","lineNumber":1250,"sourceCode":"            tok!(\"(\") => {\n                let block = self.parse_as::<SimpleBlock>()?;\n\n                let mut found_ident = false;\n\n                for component_value in &block.value {\n                    match component_value {\n                        ComponentValue::PreservedToken(token_and_span) => {\n                            match token_and_span.token {\n                                Token::WhiteSpace { .. } => {\n                                    continue;\n                                }\n                                Token::Ident { .. } => {\n                                    found_ident = true;\n\n                                    break;\n                                }\n                                _ => {\n                                    return Err(Error::new(\n                                        block.span,\n                                        ErrorKind::Expected(\n                                            \"ident at first position in <general-enclosed>\",\n                                        ),\n                                    ));\n                                }\n                            }\n                        }\n                        _ => {\n                            return Err(Error::new(\n                                block.span,\n                                ErrorKind::Expected(\n                                    \"ident at first position in <general-enclosed>\",\n                                ),\n                            ));\n                        }\n                    }\n                }","sourceCodeStart":1232,"sourceCodeEnd":1268,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/at_rules/mod.rs#L1232-L1268","documentation":"Fired while validating a <general-enclosed> in a @supports prelude: after parsing a parenthesized simple block, the parser scans its contents to confirm the first meaningful item is an Ident (a general-enclosed must look like `(ident ...)`); it is a generic validation guard and fires when the block starts with a non-ident token (e.g. a number or delimiter).","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/at_rules/mod.rs:1250 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the general-enclosed value with an ident","Report the error from the parse result","Fix the query syntax"],"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"}