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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(command-deploy): remove random spinner #2576

Merged
merged 1 commit into from
Jun 7, 2021
Merged

Conversation

erezrokah
Copy link
Contributor

- Summary

Fixes #2086
Fixes #2557

After adding some debug logs, specifically logging the error here:

async finally(error) {

I was able to reproduce the issue and get the stacktrace for it. The offending code is here:
https://github.com/sindresorhus/ora/blob/c7d6dba4a723cfa640e6adb716cb6b5dad2c22d2/index.js#L249
frames appears to be undefined.

The underlying issue is that the following line:

const cliSpinnerNames = Object.keys(require('cli-spinners'))

adds 'default' to the cliSpinnerNames array and that is not a valid spinner name.
Spinner names are validated here:
https://github.com/sindresorhus/ora/blob/c7d6dba4a723cfa640e6adb716cb6b5dad2c22d2/index.js#L171

but that code suffers from a similar bug of allowing 'default'.

I removed using a random spinner since it feels confusing anyway, however if we want to keep it we can simply use spinner: 'random'.

- Test plan

Existing tests

- A picture of a cute animal (not mandatory but encouraged)
馃悞

@erezrokah erezrokah requested a review from a team as a code owner June 7, 2021 15:55
@github-actions github-actions bot added the type: bug code to address defects in shipped code label Jun 7, 2021
@eduardoboucas
Copy link
Member

Wow! 馃槷

@erezrokah
Copy link
Contributor Author

Also sindresorhus/ora#175

@erezrokah erezrokah merged commit 4234e0d into main Jun 7, 2021
@erezrokah erezrokah deleted the fix/deploy_type_error branch June 7, 2021 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
2 participants