bombshell-dev / clack

Effortlessly build beautiful command-line apps
https://clack.cc
5.23k stars 88 forks source link

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

Open asibilia opened 9 months ago

asibilia commented 9 months ago

Environment

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:

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

Issue over on the Bun repo here: https://github.com/oven-sh/bun/issues/6052

akira-cn commented 9 months ago

I found this way will temporary solve the problem.

Insert await void(0) between each command.

await text({
    ...
});

await void(0);

await text({
    ...
});
ChristoferMendes commented 8 months ago

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?

qhariN commented 6 months ago

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 commented 1 month ago

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