Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of node:readline prevents programs from exiting #3604

Closed
rubys opened this issue Jul 11, 2023 · 2 comments
Closed

usage of node:readline prevents programs from exiting #3604

rubys opened this issue Jul 11, 2023 · 2 comments
Labels
bug Something isn't working node.js Compatibility with Node.js APIs

Comments

@rubys
Copy link

rubys commented Jul 11, 2023

What version of Bun is running?

0.6.13

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

Run the example from the node readline docs: https://nodejs.org/api/readline.html

import * as readline from 'node:readline/promises';
import { stdin as input, stdout as output } from 'node:process';

const rl = readline.createInterface({ input, output });

const answer = await rl.question('What do you think of Node.js? ');

console.log(`Thank you for your valuable feedback: ${answer}`);

rl.close();

What is the expected behavior?

Program exits upon completion

What do you see instead?

Program hangs

Additional information

Obviously prompt is a viable alternative, but I'm reporting this as Node compatibility is a goal.

See https://fly.io/blog/flydotio-heart-bun/ for more background.

@rubys rubys added the bug Something isn't working label Jul 11, 2023
@Electroid Electroid added the node.js Compatibility with Node.js APIs label Jul 11, 2023
@birkskyum
Copy link
Collaborator

This seem to exit correct in bun 0.8

@rubys
Copy link
Author

rubys commented Aug 24, 2023

Confirmed, problem no longer exists with bun 0.8

@rubys rubys closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node.js Compatibility with Node.js APIs
Projects
None yet
Development

No branches or pull requests

3 participants