question

newuser-40745718-bc7c-41f7-8c69-206b65f7f61b avatar image

HELP PARSING ERROR

Hi ... I'm having a problem with my skill

when I try to make a random playlist with the sounds

parsing error appears

I know it is a very simple solution

But I can't place it in such a way that there is no error

I would be very grateful if you help me

skillalexalambdasdk v2hosted skill
muestraaa.png (52.0 KiB)
muestra2.png (33.6 KiB)
4 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rokas avatar image Rokas commented ·

What type of error are you getting? Can you share your whole code? Or more info about what's happening?

I just spotted one thing. In canHandle of 'GetNewFactHandler' you only check if intent type is 'IntentRequest' which is almost every time true, that means, that almost any intent will get matched to that intent.

I cannot see how your "MemeSoundIntentHandler" can handle function looks like, but if it goes before get new fact handler and its can handle condition is the same, you almost never will get to get new fact handler. To solve this, instead of only checking intent type, also check intent name in can handle and match it with intent you are expecting, like:

canHandle(handlerInput) {
    return handlerInput.requestEnvelope.request.type === 'IntentRequest'
      && handlerInput.requestEnvelope.request.intent.name === 'GetNewFactIntent'
 }

I don't know how your intent is called so I just called it 'GetNewFactIntent'. Instead of it add your intent name, that you wish to get matched to this handler.


1 Like 1 ·

https://github.com/JoseJt.com

This would be my index code support by alexa hosted

and the error I receive is simply the "parsing error" when I try to add the random factor

0 Likes 0 ·
Rokas avatar image Rokas newuser-40745718-bc7c-41f7-8c69-206b65f7f61b commented ·

Ok, just tried your code, you need to add a comma at the end of string at line 145.

const data = [
  '<audio src="https://s3.amazonaws.com/lambda-christmas-sounds/christmas-sound.mp3"/>',
  '<audio src="https://s3.amazonaws.com/lambda-christmas-sounds/christmas-sound.mp3"/>'
];

Items in array have to be separated by commas.

1 Like 1 ·
Show more comments

0 Answers