-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
createStreamableUI causes multiple rerenders / UI flickering #2939
Comments
Potential duplicate of #1850 |
Can you try using |
Would be quite a big refactor and kind of would defeat the purpose of streaming RSCs. (my app is a demo of that). What I noticed it also creates this nested |
Yeah - so in a nutshell, the suspense tree is the original problem. #1825 fixes that. However, #1825 caused #1933 and needed to be reverted, and from my understanding #1933 is a next js issue. I plan to spend time investigating it but this is not trivial and may not be solvable in the AI SDK itself. |
I think its also causing this bug in my app to cause it to flicker up after each message finishes streaming. Happened only after I upgraded to @ai-sdk/openai": "^0.0.58" and "ai": "^3.3.32". Do you know what might be the most recent safe version without this bug? video.mov |
In case it might be helpful for anyone else, the most stable release I could find without the flicker where we also get OpenAI tokens usage data is 3.2.5 |
@james-pratama 3.2.5 is before the revert of #1933 - did you run into any other issues? what next.js and react versions are you using? |
I am on React 18.2.0 and still on Next 14.2.2. Have not seen any issues so far but will report back if I do. |
Description
Use
createStreamableUI
and then.append
a few items. Everyappend
will cause the previous item to render/mount (I think?) again which causes weird UI flickering. It's even more obvious when you have some fade-in animation on the items.streamui.mp4
Code example
On a page, I am just adding the returned
movieUI
in a grid component as children.<MovieGrid>{movieUI}</MovieGrid>
. Is that maybe the wrong approach?Additional context
"ai": "3.3.29"
"next": "14.2.8"
The text was updated successfully, but these errors were encountered: