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)
Pass an empty array for options when creating a new SelectPrompt
Expected behaviorSelectPrompt (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)
Environment
@clack/core
(depended on by@sentry/wizard@3.9.2
)Describe the bug
SelectPrompt
throws aTypeError
when given an empty options array.Encountered when using
@sentry/wizard@3.9.2
, see the related issue: https://github.com/getsentry/sentry-wizard/issues/400Example:
To Reproduce https://stackblitz.com/edit/node-kyd3oq?file=index.ts
Pass an empty array for
options
when creating a newSelectPrompt
Expected behavior
SelectPrompt
(andselect
from@clack/prompts
) should require at least 1 element in the array (it doesn't make sense to have no options to select from)