question

newuser-64a41272-f9be-4eda-8d84-71a5b807515c avatar image

Cannot read property 'type' of undefined error coming in log

snap11.png

Hi there,

I am getting this error in the log repeatedly,Can you please let me know what the issue is?

alexa skills kitlambdaintentssdk
snap11.png (11.5 KiB)
10 |5000

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

spazure avatar image
spazure answered

I feel your pain, this one drove me nuts in the beginning, too!!!

The error is in your lambda code. Somewhere you're trying to access a property of an object, but it doesn't know what the object is. In my case, it was a local scope variable that needed to be global. Other possibilities include a misspelled object name, or a variable that was created but never assigned anything so it's still null.

I use console.log liberally in my lambda code to help find what exactly is triggering these sorts of errors. This exact error in the log is the #1 cause of Alexa returning "Sorry, an error occurred," at least in my skills.

10 |5000

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

sungyoo avatar image
sungyoo answered

Hey it seems like you posted the same question in this post which is answered already so please refer to that post!

10 |5000

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