stevekane / promise-it-wont-hurt

A Workshopper module that teaches you to use promises in javascript
736 stars 219 forks source link

Crash when CHOOSE LANGUAGE is selected #116

Open tdtsh opened 7 years ago

tdtsh commented 7 years ago

Problem

If you select CHOOSE LANGUAGE with promise-it-wont-hurt, it exits immediately after the language selection menu is displayed

Execution environment

Reproduction procedure

git clone git@github.com:stevekane/promise-it-wont-hurt.git npm i node promise-it-wont-hurt Move the cursor to CHOOSE LANGUAGE and press the Enter key

Expected result

We can select a language from the language selection menu.

Possible cause

@timothygu/workshopper menu.js

I think the following lines are unnecessary.

  })

  menu.on('close', function () {
tdtsh commented 7 years ago

Published npm package of @timothygu/workshopper@^2.7.4 is not contain following pullrequest I think.

https://github.com/workshopper/workshopper/pull/128/files

watilde commented 7 years ago

it worked with these updates: https://github.com/watilde/promise-it-wont-hurt/commit/08591007c17543ccbc19f918d0aa3edf309b8cde, https://github.com/watilde/promise-it-wont-hurt/commit/e65e7feabba4c522915d871cf5f134f6dc602de5. It seems to be worth to try, but I guess there is something reason why this workshop is using @TimothyGu 's forked module.

tdtsh commented 7 years ago

Thanks a lot! @watilde but, this fix seems to cause another bug.

Move the cursor to CHOOSE LANGUAGE and press the Enter key Choose language (ex. English) Choose lesson (ex. Warm up)

events.js:91
      listeners[i].call(self);
                  ^

TypeError: Cannot read property 'call' of undefined