{"record":{"id":"b43699985b67f345","repo":"swc-project/swc","slug":"expected-digit","errorCode":null,"errorMessage":"Expected {} digit","messagePattern":"Expected (.+?) digit","errorType":"exception","errorClass":"swc_ecma_parser::error::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_parser/src/lexer/mod.rs","lineNumber":1316,"sourceCode":"        let lazy_integer = self.read_number_no_dot_as_str::<RADIX>()?;\n        let has_underscore = lazy_integer.has_underscore;\n\n        let s = unsafe {\n            // Safety: We got both start and end position from `self.input`\n            self.input_slice_str(lazy_integer.start, self.cur_pos())\n        };\n        if self.eat(b'n') {\n            if s.starts_with('_') {\n                return Err(Error::new(\n                    Span::new(lazy_integer.start, lazy_integer.end),\n                    SyntaxError::NumericSeparatorIsAllowedOnlyBetweenTwoDigits,\n                ));\n            }\n\n            let Some(bigint_value) = num_bigint::BigInt::parse_bytes(s.as_bytes(), RADIX as _)\n            else {\n                // just a fallback in case there is anything we did not catch\n                return Err(Error::new(\n                    Span::new(lazy_integer.start, lazy_integer.end),\n                    SyntaxError::ExpectedDigit { radix: RADIX },\n                ));\n            };\n            return Ok(Either::Right(Box::new(bigint_value)));\n        }\n        let s = remove_underscore(s, has_underscore);\n        let val = parse_integer::<RADIX>(&s);\n\n        self.ensure_not_ident()?;\n\n        Ok(Either::Left(val))\n    }\n\n    /// Consume pending comments.\n    ///\n    /// This is called when the input is exhausted.\n    #[cold]","sourceCodeStart":1298,"sourceCodeEnd":1334,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_parser/src/lexer/mod.rs#L1298-L1334","documentation":"Lexer error from read_radix_number: after the radix prefix (0x/0o/0b) the scanner requires at least one digit, but none was read (or the required digit count was not met), so the radix literal is malformed. The span covers the digit region of the literal.","triggerScenarios":"Thrown at crates/swc_ecma_parser/src/lexer/mod.rs:1316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add at least one valid digit after the radix prefix (0x1F, 0o7, 0b101)","Remove the stray prefix if a plain number was intended"],"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"}