Reputation: 1
I found this error while testing my Lambda function. I have given the export.handler function in my index.js but still I am getting the errorMessage "index.handler is undefined or not exported"
'use strict';
var Alexa = require('ask-sdk-v1adapter');
var constants = require('./constants');
var languageStrings = require('./resourceStrings');
var voiceCodeHandlers = require('./voiceCodeHandlers');
var secureHandlers = require('./secureHandlers');
exports.handler = function (event, context, callback) {
const alexa = Alexa.handler(event, context);
alexa.appId = constants.appId;
alexa.debug = constants.DEBUG;
alexa.dynamoDBTableName = constants.dynamoDBTableName;
alexa.resources = languageStrings;
alexa.registerHandlers(
voiceCodeHandlers.newSessionHandlers,
voiceCodeHandlers.codeStateHandlers,
voiceCodeHandlers.changeCodeHandlers,
voiceCodeHandlers.newCodeHandlers,
voiceCodeHandlers.helpStateHandlers,
secureHandlers
);
if (alexa.debug) {
console.log("\n" + "******************* REQUEST **********************");
console.log("\n" + JSON.stringify(event, null, 2));
}
alexa.execute();
};
Upvotes: 0
Views: 4018