unjs / consola

🐨 Elegant Console Logger for Node.js and Browser
Other
6k stars 175 forks source link

Spinner not spining #284

Open adesombergh opened 6 months ago

adesombergh commented 6 months ago

Environment

"consola": "^3.2.3" Tested on node 20 and 18

Reproduction

Stackblitz reproduction here Github repo here

Describe the bug

Following this exemple i expect consola to show a spinner while the promise resolve. However only a static ◐ character is visible.

Additional context

I don't know if it's related but the spinner function in /src/utils/prompt.ts is never called in the project.

Logs

No response

zerosrat commented 5 months ago

I search sipnner in the repo and find out sippner in src/utils/prompt.ts is never imported

m0nch1 commented 5 months ago

I search sipnner in the repo and find out sippner in src/utils/prompt.ts is never imported

As mentioned above, I think that spinner is simply not used in the sample, although it is available as an implementation. So I created a PR!

cc: @adesombergh @zerosrat

adesombergh commented 5 months ago

Thank you @m0nch1 , however changing the examples does not fix the issue. Running consola.start(), await new Promise((resolve) => setTimeout(resolve, 1000));, consola.success() will still not show an animated spinner as expected.

zerosrat commented 5 months ago

I think another way to address the use of spinner is to use other npm packages, such as ora+cli-spinners. That's what I'm doing now, using consola for the non-spinner parts and other npm packages for the spinner parts.