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

prompt.onCompletion() fails during cancel input process with vorpal.cancel #823

Closed
h-philipp opened this issue Jul 9, 2019 · 1 comment

Comments

@h-philipp
Copy link

Fail in prompt.ui and base.ui when cancel input process with vorpal.cancel(function () {
vorpal.log('Aborting... ');
return false;
})

prompt.onCompletetion() will call this.close() which then wants to remove a listener which is not available anymore (maybe with forceClose already removed):

close() {
// Remove events listeners
this.rl.removeListener('SIGINT', this.onForceClose);

TypeError: Cannot read property 'removeListener' of null
at module.exports.UI.close (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\vorpal\node_modules\inquirer\lib\ui\baseUI.js:45:11)
at module.exports.PromptUI.onCompletion (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\vorpal\node_modules\inquirer\lib\ui\prompt.js:54:8)
at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:1550:12)
at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:1489:14)
at Subject.onCompleted (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:5871:19)
at Subject.tryCatcher (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:63:31)
at AutoDetachObserverPrototype.completed (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:5796:56)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:1489:14)
at AutoDetachObserver.tryCatcher (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:63:31)
at AutoDetachObserverPrototype.completed (C:\Users\phal\workspace\amv-autologg-support-commander\node_modules\rx-lite\rx.lite.js:5796:56)

@SBoudrias
Copy link
Owner

Closing this ticket as stale. Open new issues if you encounter problem with the new Inquirer API.

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

2 participants