-
Notifications
You must be signed in to change notification settings - Fork 371
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug?]: Streaming/ async generator doesn't work #1477
Comments
It's not bug from sevoral, I've confirmed it here lxsmnsyc/seroval#31 |
I've re-tested this over again, seems like a seroval thing specifically the runtime for the async iterator, but let's just keep the tracking issue here for better visibility. |
Not quite following. Is it on the seroval side? |
@ryansolid Yep, it was a one character mistake on the minified stream constructor. It is fixed now in 1.0.7. This didn't really impact anything as the issue only happens when there's an immediate, single-push on the stream (stream thinks that the the value is the only thing in the buffer and ends immediately). For any other kind of delayed pushes, or immediate set of push-and-close, the stream normally works. async function* foo() {
"use server";
// Adding another yield here or a sleep doesn't break.
yield "This breaks";
await sleep(1000);
yield "delayed";
}
const example = await foo();
for await (const x of example) {
console.log(x);
} |
Thanks. |
Duplicates
Latest version
Current behavior 馃槸
It shows a error when I consume data from a server function
Expected behavior 馃
Should work as it was implemented in seroval
Steps to reproduce 馃暪
Steps:
I've made the reproduction here
https://github.com/ducan-ne/solid-async-generator-reproduction/blob/main/src/actions.tsx
https://github.com/ducan-ne/solid-async-generator-reproduction/blob/main/src/components/Counter.tsx
Context 馃敠
In case it's needed: node 20, macos
Your environment 馃寧
The text was updated successfully, but these errors were encountered: