Open
Description
Environment
- OS: Windows
- Node Version: v16.16.0
- Package:
@clack/core
(depended on by@sentry/wizard@3.9.2
) - Package Version: v0.3.2
Describe the bug
SelectPrompt
throws a TypeError
when given an empty options array.
Encountered when using @sentry/wizard@3.9.2
, see the related issue: getsentry/sentry-wizard#400
Example:
TypeError: Cannot read properties of undefined (reading 'value')
at SelectPrompt.changeValue (C:\Users\xyz\AppData\Local\npm-cache\_npx\ddb126e78325956c\node_modules\@clack\core\dist\index.cjs:14:3567)
at new SelectPrompt (C:\Users\xyz\AppData\Local\npm-cache\_npx\ddb126e78325956c\node_modules\@clack\core\dist\index.cjs:14:3235)
To Reproduce
https://stackblitz.com/edit/node-kyd3oq?file=index.ts
Pass an empty array for options
when creating a new SelectPrompt
Expected behavior
SelectPrompt
(and select
from @clack/prompts
) should require at least 1 element in the array (it doesn't make sense to have no options to select from)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Needs triage