{"record":{"id":"88f791afa6df0186","repo":"swc-project/swc","slug":"expected-from-to-or-percentage","errorCode":null,"errorMessage":"Expected 'from', 'to' or percentage","messagePattern":"Expected 'from', 'to' or percentage","errorType":"validation","errorClass":"swc_css_parser::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/at_rules/mod.rs","lineNumber":935,"sourceCode":"        match cur!(self) {\n            tok!(\"ident\") => {\n                let ident: Ident = self.parse()?;\n                let lower = ident.value.to_ascii_lowercase();\n\n                if lower != \"from\" && lower != \"to\" {\n                    return Err(Error::new(\n                        ident.span,\n                        ErrorKind::Expected(\"'from' or 'to' idents\"),\n                    ));\n                }\n\n                Ok(KeyframeSelector::Ident(ident))\n            }\n            tok!(\"percentage\") => Ok(KeyframeSelector::Percentage(self.parse()?)),\n            _ => {\n                let span = self.input.cur_span();\n\n                return Err(Error::new(\n                    span,\n                    ErrorKind::Expected(\"'from', 'to' or percentage\"),\n                ));\n            }\n        }\n    }\n}\n\nimpl<I> Parse<FontFeatureValuesPrelude> for Parser<I>\nwhere\n    I: ParserInput,\n{\n    fn parse(&mut self) -> PResult<FontFeatureValuesPrelude> {\n        let span = self.input.cur_span();\n\n        let mut font_family = vec![self.parse()?];\n\n        loop {","sourceCodeStart":917,"sourceCodeEnd":953,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/at_rules/mod.rs#L917-L953","documentation":"The parser could not match a keyframe selector: the current token is neither a `from`/`to` ident nor a percentage, so it reports this error. Common triggers are a bare number without `%` or an arbitrary ident.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/at_rules/mod.rs:935 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write selectors as from, to, or N%","Surface the error from the parse result","Fix the keyframes selector 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-14T00:17:10.932Z"}