{"record":{"id":"0b900e9137b9d93e","repo":"swc-project/swc","slug":"unexpected-in-declaration-value-0b900e","errorCode":null,"errorMessage":"Unexpected ')' in declaration value","messagePattern":"Unexpected '\\)' in declaration value","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/util.rs","lineNumber":386,"sourceCode":"        &mut self,\n        component_value: &ComponentValue,\n    ) -> PResult<()> {\n        let ComponentValue::PreservedToken(preserved_token) = component_value else {\n            return Ok(());\n        };\n\n        let kind = match preserved_token.token {\n            Token::BadString { .. } => ErrorKind::Unexpected(\"bad string in declaration value\"),\n            Token::BadUrl { .. } => ErrorKind::Unexpected(\"bad url in declaration value\"),\n            Token::RParen => ErrorKind::Unexpected(\"')' in declaration value\"),\n            Token::RBracket => ErrorKind::Unexpected(\"']' in declaration value\"),\n            Token::RBrace => ErrorKind::Unexpected(\"'}' in declaration value\"),\n            Token::Semi => ErrorKind::Unexpected(\"';' in declaration value\"),\n            Token::Delim { value: '!' } => ErrorKind::Unexpected(\"'!' in declaration value\"),\n            _ => return Ok(()),\n        };\n\n        Err(Error::new(preserved_token.span, kind))\n    }\n}\n\npub(super) struct WithCtx<'w, I: 'w + ParserInput> {\n    inner: &'w mut Parser<I>,\n    orig_ctx: Ctx,\n}\n\nimpl<I: ParserInput> Deref for WithCtx<'_, I> {\n    type Target = Parser<I>;\n\n    fn deref(&self) -> &Parser<I> {\n        self.inner\n    }\n}\nimpl<I: ParserInput> DerefMut for WithCtx<'_, I> {\n    fn deref_mut(&mut self) -> &mut Parser<I> {\n        self.inner","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/util.rs#L368-L404","documentation":"Fired by the declaration-value validator: a preserved ')' token (or other listed invalid preserved token such as bad string/bad url) appears inside a declaration value where no matching open block exists. Unbalanced closers are a CSS parse error, so the value is reported as invalid.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/util.rs:386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the stray ')' or add the matching opening '(' block","Rebalance parentheses inside the declaration 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-14T05:17:10.506Z"}