Solid: Virtualizer does not render any rows when using Suspense
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 using <Suspense> in solid-js with TanStack virtual, the virtualizer never renders any rows once the async data is resolved. The virtualizer receives the "count" of the data and appears to hold the data in the virtualizer, but the virtualizer never returns any rows.
I have tried a few other variations with using a signal for the ref and/or using queueMicrotask (from https://github.com/TanStack/virtual/pull/790), but neither resolves this.
I have reproduced this issue below using a variation of the Dynamic Solid example from https://github.com/TanStack/virtual/pull/658.
Your minimal, reproducible example
https://codesandbox.io/p/devbox/admiring-smoke-s3klk5
Steps to reproduce
- View the Synchronous List and see the virtualizer is working as expected.
- View the Async List and see the virtualizer never displays any rows.
Expected behavior
The async list should render the rows once suspense is resolved.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- OS: Windows 10
- Browser: Google Chrome
- Version 136.0.7103.116 (Official Build) (64-bit)
tanstack-virtual version
3.13.9
TypeScript version
5.8.3
Additional context
In my project, I am using TanStack Query to retrieve the data, TanStack Router for routing, and TanStack Table to display the data. In the example, I am not using any of these for simplicity, and the problem persists.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox and compare the Synchronous List with the Async List after Suspense resolves. Then inspect the Solid integration and the Dynamic Solid example referenced from PR #658. Done means the async list renders its rows reliably after the data is resolved, while the synchronous list continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100