-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Fallback to default injectToStream when react-streaming stream is closed #1718
Conversation
This would await for the stream to completely end though, see docs about Thus, this will probably break progressive rendering. You can test that at
There isn't any automatic formatting, so I'm inclined to think it's something on your side. |
Yup I noticed that's not the fix we need, we would need a way to check if the underlying |
I wonder why and who is trying to push to the stream even though it's
already closed.
…On Thu, Jun 27, 2024 at 3:58 PM Joël Charles ***@***.***> wrote:
Yup I noticed that's not the fix we need, we would need a way to check if
the underlying streamOriginal is closed, but I'm not sure we have that
available
—
Reply to this email directly, view it on GitHub
<#1718 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHVQRV53OBWK4IBSMVNGDDZJQK63AVCNFSM6AAAAABJ76XYEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJUG42TQMJYGE>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Looking at the log, I would say Vike itself or Vite:
|
This chunk is indeed authored by Vike (not Vite). Both Vike ( |
Could be great yes. I'm not sure if the stream created by Intuitively, I would have |
How can I reproduce the issue? |
For now I was testing with those instructions vikejs/bati#283 (comment) (and fiddling directly in node_modules) |
I tried with // vike-handler.ts
import { Writable } from 'node:stream';
...
const { readable, writable } = new TransformStream();
response?.pipe(Writable.fromWeb(writable));
return new Response(readable, {
status: response?.statusCode,
headers: response?.headers,
});
... and no error, so at least it's contained to Web streams mode. |
I just disabled stream mode by default in Bati, so you perhaps need to manually add |
Weirdly enough, if I try to copy the reproduction repo in |
👍 I'll have a look. |
🤕 I was testing on this branch with my "fix"... Anyway, I removed the fix, and pushed the repo in |
I can reproduce. |
ccdf218
to
16d374b
Compare
Actually, I cannot reproduce anymore. Neither on this PR nor on https://github.com/brillout/vike-stream-bug-2024-06. Can you systematically reproduce or is it random? |
I just pushed this tentative fix on |
Yup still reproduce, even managed get the issue on a second machine
I'll try that |
16d374b
to
c40109e
Compare
That's actually something I was expecting, let me try to reproduce on my machine. |
I can reproduce. Let me dig & fix. |
I believe #1722 fixes it. I ain't sure because I couldn't reproduce the error without the fix. But we can be confident this works if: you can reproduce the error by reverting the fix, then re-apply the fix and then not be able to reproduce the error. |
I do not have issues anymore on #1722 but how can I make sure that streaming is actually working? |
With working do you mean that it doesn't throw the error anymore or that progressive rendering works? |
The I have no error, but I'm not sure I have progressive rendering, what's the best way to test it? |
There is a progressive rendering example at |
FYI |
@brillout progressive rendering works both with Node Stream and Web Stream with latest |
Even with the universal adapter? 👀 |
Yes, that is what I was testing with my latest push 0cc3cbc |
Nice 🚀 |
@brillout I guess that a proper fix requires only to bump |
Hm, that's surprising as I think #1722 is required to avoid the race condition. There wasn't any fix regarding the race condition error in I suggest we merge 1722 in the hope it fixes the error, then let's have a look at it again if a user complains. I'm working on a |
Fixed at #1722 and released in |
Fixes vikejs/bati#283
PS: I'm not sure why imports are reordered, it's disabled in my IDE (perhaps biome does that?)