Alexa-skills-kit-sdk-for-nodejs: error using Alexa Nodejs SDK

Created on 13 Jan 2017  路  13Comments  路  Source: alexa/alexa-skills-kit-sdk-for-nodejs

Getting below error when testing an alexa hello world skill using nodejs sdk.

Can somebody point out what am I doing wrong

TypeError: Cannot read property 'locale' of undefined
at AlexaRequestEmitter.HandleLambdaEvent (/var/task/n

The offending line in SDK is
function HandleLambdaEvent() { this.locale = this._event.request.locale;

All 13 comments

resolved it myself

How did you resolve the issue? I'm getting the same thing.

I'm also getting this error. Running https://github.com/alexa/skill-sample-nodejs-howto ... Comes up after saving lambda a few times or uploading via zip.

@amitmawkin Any tips on how you resolved the issue?

Make sure you are packaging your node_modules folder in the zip uploaded for your lambda function

Use this starter template to ease deployment headaches.
Alexa Skill Serverless Starter Template

@amitmawkin Can you please elaborate your approach for resolving this error? I didn't find any proper solution to this problem so far. I'm including my node_modules folder in the zip file uploaded to lambda, but i'm getting the same error again and again.. Thanks in advance.

@pdclark did you able to solve your problem. I am having the same. No idea what I am doing wrong.

Remember to zip the contents, not the folder itself! Have you tried that?

@muttoni I have two js files and node_modules folder which I am zipping. I assume this is the right way !!

Hey guys it is a packaging issue. Usage of frameworks like serverless or others are recommended as they take care of packaging problems

try this from terminal from within the your folder having index.js...
zip -r ../lambda.zip *

It can not be a packaging issue. I am hosting the skill on my Ubuntu server with Node and I have the same error with locale: en-us in my request. That locale is enabled and on my linux server.

grrr.... looking in this source code. Is this sdk only meant to be used a lambda function and not on a self hosted node server?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sandeepajesh picture sandeepajesh  路  5Comments

dillonharlessNHRMC picture dillonharlessNHRMC  路  6Comments

slesem picture slesem  路  4Comments

ghost picture ghost  路  6Comments

developer170883 picture developer170883  路  4Comments