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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choices does not support a promise like the documentation suggests #858

Open
kbirger opened this issue Nov 5, 2019 · 0 comments
Open

Choices does not support a promise like the documentation suggests #858

kbirger opened this issue Nov 5, 2019 · 0 comments

Comments

@kbirger
Copy link

kbirger commented Nov 5, 2019

According to the readme

default, choices(if defined as functions), validate, filter and when functions can be called asynchronously. Either return a promise or use this.async() to get a callback you'll call with the final value.

However, when I try to do this, I get an error:

TypeError: choices.forEach is not a function
at listRender (.......\node_modules\inquirer\lib\prompts\list.js:157:11)

Looks like the line of code being called, and indeed, the whole file, assumes that choices will be an array.
https://github.com/SBoudrias/Inquirer.js/blob/master/packages/inquirer/lib/prompts/list.js#L157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant