You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node: 14.17.4
Language: pure JS (no transpilation) / TS (tsc into ES2020) (doesn't matter)
To be more accurate, rawlist throws multiple promise rejections if pressing "Enter" i.e. accepting after entering non-existing index. So, when validate error appears just press "Enter".
Moreover, you can't catch these rejections with .catch();
Also, custom validate function is not executing with type: "rawlist", can't evade it this way.
? sample list question
1) first
2) second
Answer: (node:109979) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
>> Please enter a valid index
assert(_.isNumber(selector))
at Choices.getChoice (/home/me/Code/e/node_modules/inquirer/lib/objects/choices.js:63:5)
at RawListPrompt.getCurrentValue (/home/me/Code/e/node_modules/inquirer/lib/prompts/rawlist.js:131:37)
at /home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/map.js:10:37
at OperatorSubscriber._this._next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:28:21)
at OperatorSubscriber.Subscriber.next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/Subscriber.js:72:18)
at Interface.handler (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js:59:31)
at Interface.emit (events.js:400:28)
at Interface._onLine (readline.js:364:10)
at Interface._line (readline.js:700:8)
at Interface._ttyWrite (readline.js:1045:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:109979) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:109979) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:109979) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(_.isNumber(selector))
at Choices.getChoice (/home/me/Code/e/node_modules/inquirer/lib/objects/choices.js:63:5)
at RawListPrompt.getCurrentValue (/home/me/Code/e/node_modules/inquirer/lib/prompts/rawlist.js:131:37)
at /home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/map.js:10:37
at OperatorSubscriber._this._next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:28:21)
at OperatorSubscriber.Subscriber.next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/Subscriber.js:72:18)
at Interface.handler (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js:59:31)
at Interface.emit (events.js:400:28)
at Interface._onLine (readline.js:364:10)
at Interface._line (readline.js:700:8)
at Interface._ttyWrite (readline.js:1045:14)
(node:109979) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:109979) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(_.isNumber(selector))
at Choices.getChoice (/home/me/Code/e/node_modules/inquirer/lib/objects/choices.js:63:5)
at RawListPrompt.getCurrentValue (/home/me/Code/e/node_modules/inquirer/lib/prompts/rawlist.js:131:37)
at /home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/map.js:10:37
at OperatorSubscriber._this._next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:28:21)
at OperatorSubscriber.Subscriber.next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/Subscriber.js:72:18)
at Interface.handler (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js:59:31)
at Interface.emit (events.js:400:28)
at Interface._onLine (readline.js:364:10)
at Interface._line (readline.js:700:8)
at Interface._ttyWrite (readline.js:1045:14)
(node:109979) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:109979) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(_.isNumber(selector))
at Choices.getChoice (/home/me/Code/e/node_modules/inquirer/lib/objects/choices.js:63:5)
at RawListPrompt.getCurrentValue (/home/me/Code/e/node_modules/inquirer/lib/prompts/rawlist.js:131:37)
at /home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/map.js:10:37
at OperatorSubscriber._this._next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:28:21)
at OperatorSubscriber.Subscriber.next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/Subscriber.js:72:18)
at Interface.handler (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js:59:31)
at Interface.emit (events.js:400:28)
at Interface._onLine (readline.js:364:10)
at Interface._line (readline.js:700:8)
at Interface._ttyWrite (readline.js:1045:14)
(node:109979) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
(node:109979) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(_.isNumber(selector))
at Choices.getChoice (/home/me/Code/e/node_modules/inquirer/lib/objects/choices.js:63:5)
at RawListPrompt.getCurrentValue (/home/me/Code/e/node_modules/inquirer/lib/prompts/rawlist.js:131:37)
at /home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/map.js:10:37
at OperatorSubscriber._this._next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:28:21)
at OperatorSubscriber.Subscriber.next (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/Subscriber.js:72:18)
at Interface.handler (/home/me/Code/e/node_modules/rxjs/dist/cjs/internal/observable/fromEvent.js:59:31)
at Interface.emit (events.js:400:28)
at Interface._onLine (readline.js:364:10)
at Interface._line (readline.js:700:8)
at Interface._ttyWrite (readline.js:1045:14)
(node:109979) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)error message
The text was updated successfully, but these errors were encountered:
SanariSan
changed the title
rawlist throw unhandable rejection
rawlist throws unhandable rejection
Sep 13, 2021
Node:
14.17.4
Language:
pure JS (no transpilation)
/TS (tsc into ES2020)
(doesn't matter)To be more accurate, rawlist throws multiple promise rejections if pressing "Enter" i.e. accepting after entering non-existing index. So, when validate error appears just press "Enter".
Moreover, you can't catch these rejections with .catch();
Also, custom validate function is not executing with type: "rawlist", can't evade it this way.
Sample code
Reproducing the error
WEBM showing error
Full terminal log from sample
The text was updated successfully, but these errors were encountered: