alexa-samples / skill-sample-nodejs-adventure-game

This tool provides an easy to use front-end that allows developers to instantly deploy code for your story, or use the generated code as a starting point for more complex projects.
Apache License 2.0
510 stars 218 forks source link

Can't call built in intents #29

Open jorobot opened 7 years ago

jorobot commented 7 years ago

Hello!

I've just about successfully completed and tested my skill, but whenever my skill calls the built in intents (HelpIntent, StopIntent or CancelIntent) the skill shuts down. I get a card saying "The target Lambda application returned a failure response" - looking at the CloudWatch logs, when attempting to call StopIntent I see this:

dispatch intent = AMAZON.StopIntent

Unexpected exception TypeError: Cannot read property 'filter' of undefined

"errorMessage": "Cannot read property 'filter' of undefined",
"errorType": "TypeError",
"stackTrace": [
    "buildPrompt (/var/task/handlers/respond.js:80:30)",
    "buildResponse (/var/task/handlers/respond.js:39:50)",
    "Object.module.exports.exitWithCard (/var/task/handlers/respond.js:23:16)",
    "defaultIntentHandlers.AMAZON.StopIntent (/var/task/handlers/intentHandlers_default.js:105:13)",
    "eventHandlers.onIntent (/var/task/handlers/eventHandlers.js:52:21)",
    "AlexaSkill.requestHandlers.IntentRequest (/var/task/AlexaSkill.js:28:33)",
    "AlexaSkill.execute (/var/task/AlexaSkill.js:79:20)"

Do you know what's going wrong here? I'm really not a coder, so any insight you could give would be very helpful! Thanks.

little-spark commented 7 years ago

I'd also like to find a solution for this. Mine isn't calling any intents for some reason after the skill starts up it doesn't recognize the command to begin.

nimzoking commented 7 years ago

OK - just completed, and everything is working fine for me. I had the odd trouble with typo's for the arn string, but no problem with the intents.

Test just done went ....

begin help begin stop

All worked fine with no errors.

Have you gone back and checked all of the braces in your intents and check the syntax in the utterance all match correctly? If you highlight a brace in the intent schema you should be able to tie up the braces with the intent - then check syntax in the utterances.

{ "intent": "AMAZON.HelpIntent" },

AMAZON.HelpIntent help

My italics added for the syntax check.

Not sure if this helps, but it could be a typo or missing brace causing the error?