node icon indicating copy to clipboard operation
node copied to clipboard

`.pipeTo(Writable.toWeb(process.stdout))` returns a never-settling Promise

Open mikaelkaron opened this issue 2 months ago • 2 comments

Version

  • v22.9.0
  • v22.12.0

Platform

Linux a54ff73afbfe 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux
Linux SURFACE9PRO 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

node:stream

What steps will reproduce the bug?

create file test.mjs

import { Readable, Writable } from 'node:stream'

await Readable.toWeb(process.stdin).pipeTo(Writable.toWeb(process.stdout))

run

echo test | node test.mjs 
test
Warning: Detected unsettled top-level await at file:///workspace/test.mjs:2
await Readable.toWeb(process.stdin).pipeTo(Writable.toWeb(process.stdout))
^

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

no warning, await to work as expected

What do you see instead?

warning about unsettled top-level await is shown

Additional information

No response

mikaelkaron avatar Dec 05 '24 01:12 mikaelkaron