{"record":{"id":"ba53bcdcb7f7dce1","repo":"swc-project/swc","slug":"expected-ident-or-function","errorCode":null,"errorMessage":"Expected ident or function","messagePattern":"Expected ident or function","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/values_and_units/mod.rs","lineNumber":2664,"sourceCode":"\n                let mut modifiers = Vec::new();\n\n                loop {\n                    if is!(self, \")\") {\n                        break;\n                    }\n\n                    match cur!(self) {\n                        tok!(\"ident\") => {\n                            modifiers.push(UrlModifier::Ident(self.parse()?));\n                        }\n                        tok!(\"function\") => {\n                            modifiers.push(UrlModifier::Function(self.parse()?));\n                        }\n                        _ => {\n                            let span = self.input.cur_span();\n\n                            return Err(Error::new(span, ErrorKind::Expected(\"ident or function\")));\n                        }\n                    }\n\n                    self.input.skip_ws();\n                }\n\n                expect!(self, \")\");\n\n                Ok(Url {\n                    span: span!(self, span.lo),\n                    name,\n                    value,\n                    modifiers: Some(modifiers),\n                })\n            }\n            _ => {\n                unreachable!()\n            }","sourceCodeStart":2646,"sourceCodeEnd":2682,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/values_and_units/mod.rs#L2646-L2682","documentation":"Fired while parsing url() modifiers: after the URL value, modifiers may only be idents or functions, but the current token is neither. The parser reports it rather than silently ignoring the bad modifier.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/values_and_units/mod.rs:2664 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid modifier (an ident or function) after the url","Remove invalid tokens between the url and its closing ')'"],"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"}