biomejs/biome · error

Input to be smaller than 4 GB

Error message

Input to be smaller than 4 GB

What it means

Error "Input to be smaller than 4 GB" thrown in biomejs/biome.

Source

Thrown at crates/biome_markdown_parser/src/lexer/mod.rs:653

                return None;
            }

            if is_valid(byte, count) {
                count += 1;
                if count > max_len {
                    return None;
                }
                i += 1;
            } else {
                return None;
            }
        }

        None
    }

    fn text_position(&self) -> TextSize {
        TextSize::try_from(self.position).expect("Input to be smaller than 4 GB")
    }

    /// Returns true if the current token text is only spaces or tabs.
    fn current_text_is_whitespace(&self) -> bool {
        let start = u32::from(self.current_start) as usize;
        let end = self.position;
        if start >= end || end > self.source.len() {
            return false;
        }
        self.source.as_bytes()[start..end]
            .iter()
            .all(|b| *b == b' ' || *b == b'\t')
    }

    /// Returns the byte at position `self.position + offset` or `None` if it is out of bounds.
    #[inline]
    fn byte_at(&self, offset: usize) -> Option<u8> {
        let position = self.position.checked_add(offset)?;

View on GitHub (pinned to 45a19bbf17)

Solutions

  1. Split inputs larger than 4 GB into smaller documents before parsing.
  2. Stream or chunk large Markdown sources instead of loading them whole.

Example fix

assert!(input.len() < u32::MAX as usize); // enforce before lexing

When it happens

Trigger: Thrown at crates/biome_markdown_parser/src/lexer/mod.rs:615 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of biomejs/biome@45a19bbf17 (2026-08-20). Data as JSON: /api/errors/f1839450938d20a3. Report an issue: GitHub.