VoxaAI/voxa-cli

npx voxa-cli interaction causes an uncaught promise

Closed this issue · 1 comments

Running npx voxa-cli interaction results in an uncaught promise:

 $ npx voxa-cli interaction
npx: installed 213 in 9.978s
timeframe: 2136.128ms
(node:5637) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'replace' of undefined
    at sanitizeView (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/src/Processor.ts:66:8)
    at _.chain.reduce (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/src/Processor.ts:96:21)
    at arrayReduce (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/node_modules/lodash/lodash.js:683:21)
    at Function.reduce (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/node_modules/lodash/lodash.js:9683:14)
    at /Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/node_modules/lodash/lodash.js:4374:28
    at arrayReduce (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/node_modules/lodash/lodash.js:683:21)
    at baseWrapperValue (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/node_modules/lodash/lodash.js:4373:14)
    at LodashWrapper.wrapperValue (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/node_modules/lodash/lodash.js:9052:14)
    at voxaSheetsViews.map (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/src/Processor.ts:107:8)
    at Array.map (<anonymous>)
    at Object.viewsProcessor (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/src/Processor.ts:77:26)
    at new Schema (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/src/Schema.ts:42:18)
    at new DialogflowSchema (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/src/DialogflowSchema.ts:56:5)
    at Object.<anonymous> (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/src/InteractionBuilder.ts:109:20)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/mat/.npm/_npx/5637/lib/node_modules/voxa-cli/lib/src/InteractionBuilder.js:4:58)
(node:5637) 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(). (rejection id: 1)
(node:5637) [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.

It doesn't seem like IVoxaSheet.data is checking if it has a value property defined before running it through the sanitizeView function.

Turns out it's caused by empty cells in the sheet, but these could be skipped during processing