{"record":{"id":"8ff8b806187ef0a4","repo":"swc-project/swc","slug":"invalid-attribute-modifier","errorCode":null,"errorMessage":"Invalid attribute modifier","messagePattern":"Invalid attribute modifier","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/selectors/mod.rs","lineNumber":836,"sourceCode":"}\n\nimpl<I> Parse<AttributeSelectorModifier> for Parser<I>\nwhere\n    I: ParserInput,\n{\n    fn parse(&mut self) -> PResult<AttributeSelectorModifier> {\n        let span = self.input.cur_span();\n\n        match cur!(self) {\n            tok!(\"ident\") => {\n                let value: Ident = self.parse()?;\n\n                Ok(AttributeSelectorModifier {\n                    span: span!(self, span.lo),\n                    value,\n                })\n            }\n            _ => return Err(Error::new(span, ErrorKind::InvalidAttrSelectorModifier)),\n        }\n    }\n}\n\nimpl<I> Parse<PseudoClassSelector> for Parser<I>\nwhere\n    I: ParserInput,\n{\n    fn parse(&mut self) -> PResult<PseudoClassSelector> {\n        let span = self.input.cur_span();\n\n        expect!(self, \":\");\n\n        if is!(self, Function) {\n            let fn_span = self.input.cur_span();\n            let name = bump!(self);\n            let names: (Atom, _) = match name {\n                Token::Function { value, raw } => (value.to_ascii_lowercase(), raw),","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/selectors/mod.rs#L818-L854","documentation":"Fired while parsing an attribute selector modifier: the token following the attribute value (in `[attr=value modifier]`) must be an ident `i` or `s` (case-sensitivity flags), but a different token was present. ErrorKind::InvalidAttrSelectorModifier is a validation-style guard; input at fault is e.g. `[title=\"x\" 1]` or any non-ident modifier.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/selectors/mod.rs:836 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid modifier ident (e.g. `i`) after the attribute selector","Collect and report parser errors","Remove the invalid modifier"],"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"}