-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
experimental_promise: A component was suspended by an uncached promise #8384
Comments
@KATT could you maybe have a look here? Here’s a similar reproduction that shows multiple combinations, all working fine without transitions but once https://codesandbox.io/p/sandbox/suspense-transitions-forked-m7vmrv I’m thinking it might be because we use |
I wish it was documented what a "a Suspense-compatible library or framework." means, it feels like we're doing something wrong but kinda fumbling in the dark. I will try to mess around with this this week 🥲 |
I can't reproduce the error consistently (proof in the video 😅) Screen.Recording.2024-12-06.at.10.04.03.mov |
@tom-sherman yeah I just got it myself only after like 4 fetches :/ |
Life and other commitments got in the way of me wrestling with this today, but I will try to have another stab next Friday https://react.dev/blog/2024/12/05/react-19#new-feature-use is a bit vague on what we need to do We create the promises in |
I think uSES getSnapshot can be called multiple times during the same render, it needs to return the same promise each time. |
Yeah we cache the whole result, including the promise and the uSES snapshot is just: Imo it should get the same promise every time |
Describe the bug
using the new experimental promise with
use
in React 19 leads to an error when multiple queries are used in the same transition. The error is:Your minimal, reproducible example
https://codesandbox.io/p/sandbox/suspense-transitions-7g9lfw
Steps to reproduce
decrease
everything works fine if we remove
startTransition
Expected behavior
Both components (2.1 and 2.2) should show the correct state values
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
React 19RC, ReactQuery 5.62.0
Tanstack Query adapter
react-query
TanStack Query version
5.62.0
TypeScript version
Additional context
Initially, I wanted to test if
placeholderData: keepPreviousData
works inside transitions. And it does - but I found those weird errors, and noticed they have nothing to do withplaceholderData
, but rather always happen if use the same transition value in multiple queries. It doesn’t matter if they are in the same suspense boundary or not.The text was updated successfully, but these errors were encountered: