-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Bug: [Flight] Async server components in ai/rsc
not rendered correctly
#28595
Labels
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
Comments
unstubbable
added
the
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
label
Mar 20, 2024
A potential fix is mentioned in the code comments of #28283:
|
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 20, 2024
The added test, intended to fail and reproduce the reported issue, unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured of the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be obscuring the actual error. If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 20, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 20, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. (Possibly related to fake timers?) If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 20, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. (Possibly related to fake timers?) If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 21, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. (Maybe related to fake timers?) If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 23, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. (Maybe related to fake timers?) If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 23, 2024
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 23, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. (Maybe related to fake timers?) If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 23, 2024
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 29, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. (Maybe related to fake timers?) If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
added a commit
to unstubbable/react
that referenced
this issue
Mar 29, 2024
The added test, intended to fail and reproduce the [reported issue](facebook#28595), unexpectedly passes in its current state. I see three possible reasons: 1. The bug report could be invalid. 2. How I've structured the test might be insufficient to replicate what `ai/rsc` is doing. 3. Something in the test setup could be masking the actual error. (Maybe related to fake timers?) If the problem lies in reason 2 or 3, this test could possibly serve as a foundation for further investigation.
unstubbable
changed the title
Bug: [Flight] Async server components in
Bug: [Flight] Async server components in Mar 30, 2024
ai/rsc
not serialized correctlyai/rsc
not rendered correctly
sebmarkbage
pushed a commit
that referenced
this issue
Apr 1, 2024
Alternative to #28620. Instead of emitting lazy references to not-yet-emitted models in the Flight Server, this fixes the observed issue in unstubbable/ai-rsc-test#1 by adjusting the lazy model resolution in the Flight Client to update stale blocked root models, before assigning them as chunk values. In addition, the element props are not outlined anymore in the Flight Server to avoid having to also handle their staleness in blocked elements. fixes #28595
github-actions bot
pushed a commit
that referenced
this issue
Apr 1, 2024
Alternative to #28620. Instead of emitting lazy references to not-yet-emitted models in the Flight Server, this fixes the observed issue in unstubbable/ai-rsc-test#1 by adjusting the lazy model resolution in the Flight Client to update stale blocked root models, before assigning them as chunk values. In addition, the element props are not outlined anymore in the Flight Server to avoid having to also handle their staleness in blocked elements. fixes #28595 DiffTrain build for [93f9179](93f9179)
EdisonVan
pushed a commit
to EdisonVan/react
that referenced
this issue
Apr 15, 2024
…ok#28669) Alternative to facebook#28620. Instead of emitting lazy references to not-yet-emitted models in the Flight Server, this fixes the observed issue in unstubbable/ai-rsc-test#1 by adjusting the lazy model resolution in the Flight Client to update stale blocked root models, before assigning them as chunk values. In addition, the element props are not outlined anymore in the Flight Server to avoid having to also handle their staleness in blocked elements. fixes facebook#28595
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When returning an async server component from an
ai/rsc
tool'srender
function, a reference to it is not serialized as a lazy node, even though it might not have been emitted as a row yet. Currently the React Flight Client is not resilient to this. This leads to the reference not being resolved correctly, and thennull
is rendered instead of the element.The bug was introduced with #28283.
React version: 18.3.0-canary-6c3b8dbfe-20240226 (via Next.js v14.2.0-canary.30)
Steps To Reproduce
ai/rsc
example according to https://sdk.vercel.ai/docs/concepts/ai-rsc#build-your-apprender
function to an async server component(It's probably also reproducible by writing a unit test that replicates what's being done in https://github.com/vercel/ai/blob/main/packages/core/rsc/utils.tsx#L17-L50. I might try this later... done)
Link to code example: unstubbable/ai-rsc-test#1
This contains the code of step 2 from above, has more details about the expected and actual RSC responses, and also shows in the comments how I arrived at my conclusion.
The text was updated successfully, but these errors were encountered: