TanStack / TanStack/virtual

List size is capped by browser/memory

Open
#565 17 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.1k
Forks
466
Avg merge
2d 31m
Merged PRs (30d)
13

Description

Describe the bug

When trying to create a list with a large count of rows, one of two things happens:

A. If the count is over an arbitrary number, capped by each browser individually, the scroll won't go over that row.
For instance, for Chrome that number is 479348, and you can't scroll to the remaining items if there are any.

B. If the number is too large (for instance 150 mil), the tab will simply crash.
I believe this is caused by the getMeasurements function from the virtual-core library, as it tries to create an array of the count size.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/silent-wildflower-594ycm

Steps to reproduce
  1. In the sandbox click on one of the example buttons that will set a larger number, or edit the count property manually.
Expected behavior

A. I expect the scroll to allow the user to reach the exact number specified in the count.
B. I expect the browser not to crash .

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • Any but specifically I'm using:
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
tanstack-virtual version

v3.0.0-beta.54

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the linked CodeSandbox, testing the large-count examples in a browser. Start by inspecting the virtual-core getMeasurements function mentioned in the report and compare behavior at the browser limit and at 150 million rows. Done means the requested count remains reachable without the tab crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.