Launch always goes to incorrect intent

amazon-alexa

#1

I am trying to build music skill based on Jovo podcast-player example, I am having hard time debugging one issue.
In this I am asking user to choose from different intent, when user choose Namokar mantra, it never goes to that intent it always go to Firstepisode intent, even though none of the phrase match.

image


#2

@jan @H1Gerd Is there any routing config we have to do which i am missing, podcast is the example I used and I am making changes? Even if i do toIntent() its not going to correct one from Launch. It always go to firstepisodeIntent.


#3

Have you tried restarting the development server? ctrl + c and then jovo run again.


Could not find the route "NextIntent" in your handler function
#4

What platform are you using to debug? If you’re trying to run this on an Amazon Alexa, I would make sure that the intents that you defined (Namokar, Songs, etc.) are all showing up in the Alexa development console. Also, do you know if the program is going to the FirstEpisodeIntent directly, or are you getting the UnhandledIntent and being re-routed to FirstEpisodeIntent?


#5

Yes… i did that several time… but no luck


#6

If i use toIntent it gives me unhandled exception, but if i run launch and respond to launch request command. It takes me to FirstEpisodeIntent directly. I put debug point in FirstEpisodeIntent and i can see its going there.


#7

If i add toIntent in Launch i get unhandled error, where as if comment that line it will go to FirstEpisodeHandle. I am sharing link to all project files in case that helps…

https://drive.google.com/open?id=1uFh1FrR7DsXMjU-s2pJW5D8TOn-hm5Wh


#8

Hi @akshayru, I don’t know if it matters, but I’ve always used the argument within the toIntent call surround by quotes. In your case, I would try this.toIntent('FirstEpisodeIntent');

I also recommend as good practice creating an Unhandled() intent handler with a console.log just to see if your skill is passing through that handler unexpectedly.

When you view your skill in the Alexa Developer Console, do you see all of your intents?


#9

Yes, seems like the problem is that the intent name is not a string. Thanks for spotting @Ben_Hartman!

A few additional things.

Never use stuff like ask or tell after an intent redirect like toIntent.

I recommend using a return statement for redirects:

LAUNCH() {
    // ...

   return this.toIntent('FirstEpisodeIntent'); // last thing to happen in ths handler
}

closed #10