{"action":"created","issue":{"url":"https://api.github.com/repos/amwmedia/plop/issues/48","repository_url":"https://api.github.com/repos/amwmedia/plop","labels_url":"https://api.github.com/repos/amwmedia/plop/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/amwmedia/plop/issues/48/comments","events_url":"https://api.github.com/repos/amwmedia/plop/issues/48/events","html_url":"https://github.com/amwmedia/plop/issues/48","id":188074395,"number":48,"title":"Inquirer plugin crashes with plop 1.6.0","user":{"login":"pavanpodila","id":156846,"avatar_url":"https://avatars.githubusercontent.com/u/156846?v=3","gravatar_id":"","url":"https://api.github.com/users/pavanpodila","html_url":"https://github.com/pavanpodila","followers_url":"https://api.github.com/users/pavanpodila/followers","following_url":"https://api.github.com/users/pavanpodila/following{/other_user}","gists_url":"https://api.github.com/users/pavanpodila/gists{/gist_id}","starred_url":"https://api.github.com/users/pavanpodila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavanpodila/subscriptions","organizations_url":"https://api.github.com/users/pavanpodila/orgs","repos_url":"https://api.github.com/users/pavanpodila/repos","events_url":"https://api.github.com/users/pavanpodila/events{/privacy}","received_events_url":"https://api.github.com/users/pavanpodila/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-08T18:56:56Z","updated_at":"2016-11-08T19:01:16Z","closed_at":"2016-11-08T19:00:45Z","body":"Looks like there is some mismatch in `plop`, `inquirer`, around the use of promises:\r\n\r\nOffending code:\r\n**plop/node_modules/inquirer/lib/ui/prompt.js:79:50**\r\n```js linenos\r\nPromptUI.prototype.fetchAnswer = function (question) {\r\n  var Prompt = this.prompts[question.type];\r\n  var prompt = new Prompt(question, this.rl, this.answers);\r\n  return rx.Observable.defer(function () {\r\n// This next lines fails as prompt.run() doesn't seem to return a promise\r\n    return rx.Observable.fromPromise(prompt.run().then(function (answer) {\r\n      return {name: question.name, answer: answer};\r\n    }));\r\n  });\r\n};\r\n\r\n```\r\n\r\nLog:\r\n```\r\n(Use \"/\" key to search this directory)[ERROR] Cannot read property 'then' of undefined TypeError: Cannot read property 'then' of undefined\r\n    at /Users/ppodil/Projects/react-mobx-seed/node_modules/plop/node_modules/inquirer/lib/ui/prompt.js:79:50\r\n    at tryCatcher (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:63:31)\r\n    at Defer.subscribeCore (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:2536:37)\r\n    at Defer.tryCatcher (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:63:31)\r\n    at setDisposable (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:2082:46)\r\n    at Defer.Rx.ObservableBase.ObservableBase._subscribe (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:2097:9)\r\n    at Defer.Rx.Observable.observableProto.subscribe.observableProto.forEach (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:2034:19)\r\n    at MergeObserver.handleSubscribe (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:3525:28)\r\n    at MergeObserver.next (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:3531:14)\r\n    at MergeObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/ppodil/Projects/react-mobx-seed/node_modules/rx/dist/rx.js:1762:31)\r\n\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/amwmedia/plop/issues/comments/259227260","html_url":"https://github.com/amwmedia/plop/issues/48#issuecomment-259227260","issue_url":"https://api.github.com/repos/amwmedia/plop/issues/48","id":259227260,"user":{"login":"amwmedia","id":732336,"avatar_url":"https://avatars.githubusercontent.com/u/732336?v=3","gravatar_id":"","url":"https://api.github.com/users/amwmedia","html_url":"https://github.com/amwmedia","followers_url":"https://api.github.com/users/amwmedia/followers","following_url":"https://api.github.com/users/amwmedia/following{/other_user}","gists_url":"https://api.github.com/users/amwmedia/gists{/gist_id}","starred_url":"https://api.github.com/users/amwmedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amwmedia/subscriptions","organizations_url":"https://api.github.com/users/amwmedia/orgs","repos_url":"https://api.github.com/users/amwmedia/repos","events_url":"https://api.github.com/users/amwmedia/events{/privacy}","received_events_url":"https://api.github.com/users/amwmedia/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T19:01:16Z","updated_at":"2016-11-08T19:01:16Z","body":"I'm happy to re-open this issue if there are other possible ways to address this issue."}}
{"actor":{"display_login":"amwmedia"}}