Error AtlasError Documentation and Resolution

JavaScript string repeat count was too large

RangeError: repeat count must be less than infinity

JavaScript rejected a string repeat operation because the requested output would be too large.

RangeError: repeat count must be less than infinityruntime
RangeError: repeat count must be less than infinity
  • String.repeat received an extremely large count.
  • User input or computed values were passed into repeat() without bounds checking.
  • A size multiplier produced unrealistic output volume.
  1. Validate and cap repeat counts before calling repeat().
  2. Avoid building huge strings in memory when streaming or chunking would work better.
  3. Trace where the count originates and stop runaway multiplication or parsing bugs.
MDN: RangeError: repeat count must be less than infinity
JavaScript repeat count must be less than infinity | Error Atlas