{"record":{"id":"dd148e843e68f394","repo":"swc-project/swc","slug":"expected-none-value-of-an-ident-token","errorCode":null,"errorMessage":"Expected 'none' value of an ident token","messagePattern":"Expected 'none' value of an ident token","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/values_and_units/mod.rs","lineNumber":1547,"sourceCode":"                    values.push(ComponentValue::Delimiter(self.parse()?));\n\n                    self.input.skip_ws();\n\n                    let alpha_value = self.try_parse_variable_function(\n                        |parser, has_variable_before| match cur!(parser) {\n                            tok!(\"number\") | tok!(\"percentage\") => {\n                                Ok(Some(ComponentValue::AlphaValue(parser.parse()?)))\n                            }\n                            Token::Function { value, .. } if is_math_function(value) => {\n                                Ok(Some(ComponentValue::Function(parser.parse()?)))\n                            }\n                            tok!(\"ident\") if !matches!(&*lower_fname, \"device-cmyk\") => {\n                                let ident: Box<Ident> = parser.parse()?;\n\n                                if ident.value.eq_ignore_ascii_case(\"none\") {\n                                    Ok(Some(ComponentValue::Ident(ident)))\n                                } else {\n                                    Err(Error::new(\n                                        ident.span,\n                                        ErrorKind::Expected(\"'none' value of an ident token\"),\n                                    ))\n                                }\n                            }\n                            _ => {\n                                if !has_variable_before {\n                                    Err(Error::new(\n                                        parser.input.cur_span(),\n                                        ErrorKind::Expected(\n                                            \"percentage, number, function (math functions) or \\\n                                             ident (with 'none' value) token\",\n                                        ),\n                                    ))\n                                } else {\n                                    Ok(None)\n                                }\n                            }","sourceCodeStart":1529,"sourceCodeEnd":1565,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/values_and_units/mod.rs#L1529-L1565","documentation":"Fired while parsing an alpha component (e.g. in rgb()/hsl() color functions): the token must be a number, percentage, math function, or the ident 'none', but none matched. The parser cannot interpret the token as an alpha value.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/values_and_units/mod.rs:1547 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a number (0-1), a percentage, a math function like calc(), or 'none' for the alpha slot","Fix typos in the alpha value"],"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"}