sindresorhus/ora

After setting the spinner property, an error occurs when the stop method is called

soeasyjx opened this issue · 0 comments

Description

When I set the value of spinner to bouncingBar according to the documentation, the returned instance does not have stop methods, and the terminal directly reports ReferenceError: spinner is not defined

version

node: 18.14.1
ora: "^6.3.1"

code fragment

const login = async () => {
  try {
    const { default: ora } = await import("ora");
    const spinner = ora({
        text: "开始进行登录",
       spinner: "bouncingBar"
    }).start();
    // ...........
   // ...........
    spinner.success("success");
  } catch (error) {
    spinner.fail("fail");
    throw error;
  }
}

login()

result

ReferenceError: spinner is not defined