jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.67k stars 310 forks source link

Displaying Standard Card Throws Error #180

Closed MerryOscar closed 6 years ago

MerryOscar commented 6 years ago

I'm submitting a...

Expected Behavior

When trying to display a Standard Card for Alexa by calling:

this.alexaSkill().showImageCard('Title', 'Content', {
  smallImageUrl: 'https://www.jovo.tech/img/logo.png',
  largeImageUrl: 'https://www.jovo.tech/img/logo.png',
});

The card should be displayed as per the docs here - https://www.jovo.tech/docs/amazon-alexa/visual#standard-card

Current Behavior

An error is thrown.

Error log

TypeError: (intermediate value).setTitle(...).setText(...).setSmallImageUrl is not a function
    at AlexaResponse.addStandardCard (/Users/oscar/repos/test/node_modules/jovo-framework/lib/platforms/alexaSkill/alexaResponse.js:140:14)
    at AlexaSkill.showStandardCard (/Users/oscar/repos/test/node_modules/jovo-framework/lib/platforms/alexaSkill/alexaSkill.js:717:23)
    at AlexaSkill.showImageCard (/Users/oscar/repos/test/node_modules/jovo-framework/lib/platforms/alexaSkill/alexaSkill.js:701:21)
    at Object.renderWelcomeDisplay (/Users/oscar/repos/test/helpers/Display.js:24:24)
    at Jovo.Launch (/Users/oscar/repos/test/handlers/Launch.js:11:11)
    at Promise (/Users/oscar/repos/test/node_modules/jovo-framework/lib/handler.js:51:36)
    at new Promise (<anonymous>)
    at Handler.handle (/Users/oscar/repos/test/node_modules/jovo-framework/lib/handler.js:26:16)
    at loadUserDataOnRequest.then.then.then.then.then.then (/Users/oscar/repos/test/node_modules/jovo-framework/lib/jovo.js:186:43)
    at <anonymous>

Your Environment

MerryOscar commented 6 years ago

This was caused by having the second content parameter as an empty string.