You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node:readline/promises prevents program from terminating #30075
import*asreadlinefrom"node:readline/promises";asyncfunctioninput(question){constrl=readline.createInterface({input: process.stdin,output: process.stdout,});constanswer=awaitrl.question(question);rl.close();returnanswer;}input("What is your name? ").then(console.log);
I would expect this program to ask for input, print it, and then exit, but instead it hangs after printing. If I press enter a second time, the program terminates.
A similar program with the callback API does not exhibit this behavior
Working, callback based approach
import*asreadlinefrom"node:readline";functioninput(question,callback){constrl=readline.createInterface({input: process.stdin,output: process.stdout,});rl.question(question,(answer)=>{rl.close();callback(answer);});}input("What is your name? ",console.log);
I've included strace output from running the promise-based program. It appears to be waiting on some kind of input with epoll (though frankly I'm not sure what).
Both of these programs work as I would expect under node, which makes me think it's a deno bug.
Activity
bartlomieju commentedon Mar 3, 2026
fix(ext/node): `node:readline/promises` prevents program from termina…
fix(ext/node): rewrite node:tty on top of uv compat (#32777)