Version
v26.3.1
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
No response
What steps will reproduce the bug?
The following code reproduces the bug:
import { connect, createServer } from "net";
import { Duplex } from "stream";
const server = createServer();
server.on("connection", (socket) => {
socket.end();
});
server.listen(8444, () => {
console.log("server listening on port 8444");
});
const socket = connect({ host: "localhost", port: 8444 });
const conn = Duplex.toWeb(socket);
const reader = conn.readable.getReader();
const writer = conn.writable.getWriter();
try {
await reader.read();
await writer.close();
} catch {}
How often does it reproduce? Is there a required condition?
Happens consistently on Node 26.3.0 and 26.3.1
Doesn't happen on Node 26.2.0
What is the expected behavior? Why is that the expected behavior?
It should not produce an uncatchable exception.
What do you see instead?
Node will exit with the uncaught exception:
node:internal/webstreams/adapters:224
controller.error(new AbortError());
^
TypeError: Cannot read properties of undefined (reading 'error')
at Socket.<anonymous> (node:internal/webstreams/adapters:224:16)
at Socket.<anonymous> (node:internal/util:581:20)
at Socket.onfinish (node:internal/streams/end-of-stream:238:16)
at Socket.emit (node:events:509:20)
at finish (node:internal/streams/writable:955:10)
at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
Additional information
No response
Version
v26.3.1
Platform
Subsystem
No response
What steps will reproduce the bug?
The following code reproduces the bug:
How often does it reproduce? Is there a required condition?
Happens consistently on Node 26.3.0 and 26.3.1
Doesn't happen on Node 26.2.0
What is the expected behavior? Why is that the expected behavior?
It should not produce an uncatchable exception.
What do you see instead?
Node will exit with the uncaught exception:
Additional information
No response