{"record":{"id":"4c2e820e94eba41a","repo":"swc-project/swc","slug":"expected-at-the-start-of-dashed-ident","errorCode":null,"errorMessage":"Expected '--' at the start of dashed-ident","messagePattern":"Expected '--' at the start of dashed-ident","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/values_and_units/mod.rs","lineNumber":1867,"sourceCode":"        }\n    }\n}\n\nimpl<I> Parse<DashedIdent> for Parser<I>\nwhere\n    I: ParserInput,\n{\n    fn parse(&mut self) -> PResult<DashedIdent> {\n        let span = self.input.cur_span();\n\n        if !is!(self, Ident) {\n            return Err(Error::new(span, ErrorKind::Expected(\"Ident\")));\n        }\n\n        match bump!(self) {\n            Token::Ident { value, raw, .. } => {\n                if !value.starts_with(\"--\") {\n                    return Err(Error::new(\n                        span,\n                        ErrorKind::Expected(\"'--' at the start of dashed-ident\"),\n                    ));\n                }\n\n                if value.len() < 3 {\n                    return Err(Error::new(\n                        span,\n                        ErrorKind::Expected(\"dashed-ident must be at least 3 characters\"),\n                    ));\n                }\n\n                Ok(DashedIdent {\n                    span,\n                    value: self.input.atom(&value[2..]),\n                    raw: Some(raw),\n                })\n            }","sourceCodeStart":1849,"sourceCodeEnd":1885,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/values_and_units/mod.rs#L1849-L1885","documentation":"Fired by the DashedIdent parser: an Ident token was found, but its value does not start with '--', so it is not a <dashed-ident>. Only identifiers beginning with two hyphens (custom-property style) are accepted.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/values_and_units/mod.rs:1867 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prefix the identifier with '--' (e.g. '--my-var')","Use a plain Ident type if the double-dash prefix is not required"],"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"}