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

[Bug] Has anyone been able to get the @clack/prompts example working with Bun? #170

Open
asibilia opened this issue Sep 25, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@asibilia
Copy link

asibilia commented Sep 25, 2023

Environment

  • OS: macOS
  • Node Version: v19.7.0
  • Package: @clack/prompts
  • Package Version: v0.2.0

Describe the bug
When running the StackBlitz example from the documentation using Bun, the process exits after the first user input rather than completing all questions.

To Reproduce
https://github.com/asibilia/cli-tool

Steps to reproduce the behavior:

  • Clone repo linked above ☝🏼
  • bun install
  • Run script using bun index.ts

Expected behavior
Should run the example script from the docs as expected.

Issue over on the Bun repo here: oven-sh/bun#6052

@asibilia asibilia added the bug Something isn't working label Sep 25, 2023
@akira-cn
Copy link

I found this way will temporary solve the problem.

Insert await void(0) between each command.

await text({
    ...
});

await void(0);

await text({
    ...
});

@ChristoferMendes
Copy link

I found this way will temporary solve the problem.

Insert await void(0) between each command.

await text({
    ...
});

await void(0);

await text({
    ...
});

This does not worked out for me 😔

But I was curious, what exactly does await void(0) do and why would that be a solution?

@jh0rman
Copy link

jh0rman commented Dec 15, 2023

Looks like this issue has already been addressed in the latest release of Bun, v1.0.18. You can find more details about the fix in the release notes: Bun v1.0.18 Release Notes.

@braebo
Copy link

braebo commented May 6, 2024

Bun runs it fine, but chokes on the build:

 bun build index.ts
1 | s l,erase as d}from"sisteransi";import{stdin as $,stdout as k}from"node:process";import*as f from"node:readline";import
                                                          ^
error: No matching export in "node:process" for import "stdin"
    at /Users/bew/dev/scripts/tui/lss/node_modules/@clack/core/dist/index.mjs:1:55

1 | s d}from"sisteransi";import{stdin as $,stdout as k}from"node:process";import*as f from"node:readline";import _ from"node
                                                                     ^
error: No matching export in "node:process" for import "stdout"
    at /Users/bew/dev/scripts/tui/lss/node_modules/@clack/core/dist/index.mjs:1:66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants