{"record":{"id":"b04ae2b55dfaa511","repo":"swc-project/swc","slug":"unterminated-block-comment","errorCode":null,"errorMessage":"Unterminated block comment","messagePattern":"Unterminated block comment","errorType":"validation","errorClass":"swc_css_parser::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/lexer/mod.rs","lineNumber":553,"sourceCode":"                                    // Safety: last_pos is a valid position\n                                    self.input.slice(cmt_start, last_pos)\n                                };\n\n                                self.pending_leading_comments.push(Comment {\n                                    kind: CommentKind::Block,\n                                    span: (self.start_pos, last_pos).into(),\n                                    text: self.atoms.atom(text),\n                                });\n                            }\n\n                            break;\n                        }\n                        None => {\n                            let span = Span::new(self.start_pos, self.input.last_pos());\n\n                            self.errors\n                                .borrow_mut()\n                                .push(Error::new(span, ErrorKind::UnterminatedBlockComment));\n\n                            return;\n                        }\n                        _ => {}\n                    }\n                }\n            }\n        } else if self.config.allow_wrong_line_comments\n            && self.next() == Some(b'/')\n            && self.next_next() == Some(b'/')\n        {\n            while self.next() == Some(b'/') && self.next_next() == Some(b'/') {\n                self.consume(1); // '/'\n                self.consume(1); // '/'\n\n                let start_of_content = self.input.last_pos();\n\n                loop {","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/lexer/mod.rs#L535-L571","documentation":"The CSS lexer reached EOF while scanning a /* ... */ block comment, so the comment never closes. read_comments records the comment text gathered so far and pushes this recoverable error into the parser's error list rather than aborting the parse.","triggerScenarios":"Thrown at crates/swc_css_parser/src/lexer/mod.rs:553 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Close the block comment with */ in the CSS source","Inspect the parser's collected errors after parsing to report this to users","Demote to a warning if lenient parsing is acceptable"],"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"}