Open masx200 opened 2 years ago
v18.3.0
Microsoft Windows NT 10.0.22621.0 x64
No response
import stream from "stream"; await test2(); async function test2() { console.log("good"); const readable = stream.Readable.from("11111222222222".repeat(999)); const readableStream = stream.Readable.toWeb(readable); const [stream1, stream2] = readableStream.tee(); //good // const streams = [stream1, stream2]; await Promise.all( streams.map(async (temp) => { console.log(temp); for await (const data of stream.Readable.fromWeb(temp)) { console.log(data); } }) ); } await test1(); async function test1() { console.log("error"); const readable = stream.Readable.from("11111222222222".repeat(999)); const readableStream = stream.Readable.toWeb(readable); const [stream1, stream2] = readableStream.tee(); //error console.log(stream1); for await (const data of stream.Readable.fromWeb(stream1)) { console.log(data); } console.log(stream2); for await (const data of stream.Readable.fromWeb(stream2)) { console.log(data); } }
node "C:\Documents\test\test.mjs"
100% occur.
no errors
good ReadableStream { locked: false, state: 'readable', supportsBYOB: false } ReadableStream { locked: false, state: 'readable', supportsBYOB: false } <Buffer 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 ... 13936 more bytes> <Buffer 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 ... 13936 more bytes> error ReadableStream { locked: false, state: 'readable', supportsBYOB: false } <Buffer 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 32 32 32 32 32 32 31 31 31 31 31 32 32 32 ... 13936 more bytes> ReadableStream { locked: false, state: 'readable', supportsBYOB: false } node:internal/process/esm_loader:91 internalBinding('errors').triggerUncaughtException( ^ Error [ERR_STREAM_PUSH_AFTER_EOF]: stream.push() after EOF at new NodeError (node:internal/errors:377:5) at readableAddChunk (node:internal/streams/readable:285:30) at Readable.push (node:internal/streams/readable:234:10) at node:internal/webstreams/adapters:481:22 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'ERR_STREAM_PUSH_AFTER_EOF' } Node.js v18.3.0
Is this a duplicate of https://github.com/nodejs/node/issues/42694 ?
@masx200 Looks like the latest version doesn't have this issue anymore. cc @VoltrexKeyva
Version
v18.3.0
Platform
Microsoft Windows NT 10.0.22621.0 x64
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
100% occur.
What is the expected behavior?
no errors
What do you see instead?
Additional information
No response