Skip to content

[Bug] When starting a spinner, the process won't stop after your script is done executing. #348

@ivands

Description

@ivands

Environment

  • OS: macOS
  • Deno Version: 2.2.4
  • Package: @clack/prompts
  • Package Version: 0.11.0

Describe the bug
When starting a spinner, the node / deno process won't stop after your script is done executing.

To Reproduce
Just start the spinner and stop it.
Your process should never quit on its own from now on.

Expected behavior
Your process should properly stop after stopping the spinner.

Additional Information
It probably has something to do with an event listener that's not being cleaned up properly.

Activity

43081j

43081j commented on Jul 1, 2025

@43081j
Collaborator

do you mean you didn't call stop()?

this makes sense as there's nothing we can listen for. an exit won't happen because the spinner is still iterating on a timer in the background, so there's no exit event to catch.

if something forcefully exits, the spinner does stop.

but you really should call stop()

its the same as if you had a setInterval running in your code somewhere, it'll never exit if you don't clean it up.

if you are calling stop, please provide an example as i can't reproduce that

ivands

ivands commented on Jul 3, 2025

@ivands
Author

I mean after calling stop

43081j

43081j commented on Jul 3, 2025

@43081j
Collaborator

if you are calling stop, please provide an example as i can't reproduce that

do you have an example?

i've tried this locally and it works fine, so i think we will need a reproduction from you

ivands

ivands commented on Jul 3, 2025

@ivands
Author

Yeah, so I just tried it on Node and it seems to work.
But in Deno it will get stuck.

import { spinner } from '@clack/prompts'

const spin = spinner()
spin.start('Hello')
spin.stop('World')

However, i also had instances where my cli tool running in node would get stuck.
Just not sure now if the spinner was the problem anymore XD

43081j

43081j commented on Jul 3, 2025

@43081j
Collaborator

i also can't reproduce that in main, so i wonder if its a long gone problem

can you try out 1.0.0-alpha.1 and see if it still happens? so we at least know if its been fixed in latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ivands@43081j

        Issue actions

          [Bug] When starting a spinner, the process won't stop after your script is done executing. · Issue #348 · bombshell-dev/clack