-
Notifications
You must be signed in to change notification settings - Fork 7
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
renderToReadableStream
breaks in Workers runtime
#1
Comments
Tracking here: facebook/react#22772 |
I just updated to And boom, we've just isolated our issue:
This appears to be a bug in the way React is writing to the stream when in a SW/Workers runtime. |
By modifying the Suspense contents a bit in <Suspense fallback={<Spinner />}>
<Comments />
</Suspense>
+ <Suspense fallback={<Spinner />}>
+ <Comments />
+ </Suspense> If you run
This indicates that React is attempting to flush the same segment multiple times. Why is this? Let's find out... If we walk down the stacktrace, all the way to function flushCompletedQueues(request, destination) {
try {
throw new Error('test');
} catch (e) {
console.log(`flushCompletedQueues called from stack: ${e.stack.split('\n').slice(1).join('\n')}`);
}
// ...
} This leads to the following output when we run the script again:
This makes me wonder: is the Should there be some sort of check like Or maybe |
pipeToReadableStream
breaks in Workers runtimerenderToReadableStream
breaks in Workers runtime
This is fixed upstream! 🎉 facebook/react#23342 |
When bundling a worker file and running it with miniflare, the following error is observed in the server console:
In the browser, it appears as though it works, but you'll also notice a browser console error:
This is because the stream pushing out an invalid chunk:
To repro:
The text was updated successfully, but these errors were encountered: