I get this strange error, when I try to import a JS file, which was written in ES6 and transipled to ES5. I was trying to debug, why exactly inquirer.prompt.prompts[promptType] gives me null and I found out that for some reason after UI._loop goes through all var prompts = ['input', 'checkbox', 'confirm', 'expand', 'list', 'password', 'rawlist']; it then receives key = 'min' ? and consequently var promptType = prompts[key]; is a [Function: val] that returns Infinity or NaN. Very strange, especially that I am rather new to JS.
/Users/asiron/code/ethereum/fincontracts-client/node_modules/vorpal/dist/ui.js:122
inquirer.prompt.prompts[promptType].prototype.getType = function () {
^
TypeError: Cannot read property 'prototype' of undefined
at _loop (/Users/asiron/code/ethereum/fincontracts-client/node_modules/vorpal/dist/ui.js:122:42)
at new UI (/Users/asiron/code/ethereum/fincontracts-client/node_modules/vorpal/dist/ui.js:149:7)
at Object.<anonymous> (/Users/asiron/code/ethereum/fincontracts-client/node_modules/vorpal/dist/ui.js:594:10)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
I get this strange error, when I try to import a JS file, which was written in ES6 and transipled to ES5. I was trying to debug, why exactly
inquirer.prompt.prompts[promptType]
gives menull
and I found out that for some reason afterUI._loop
goes through allvar prompts = ['input', 'checkbox', 'confirm', 'expand', 'list', 'password', 'rawlist'];
it then receiveskey = 'min'
? and consequentlyvar promptType = prompts[key];
is a[Function: val]
that returnsInfinity
orNaN
. Very strange, especially that I am rather new to JS.I am using: