errorType ":" Runtime.HandlerNotFound "для AWS лямбда-функции - PullRequest
0 голосов
/ 06 мая 2020

Я обнаружил эту ошибку при тестировании своей лямбда-функции. Я добавил функцию export.handler в свой index. js, но все равно получаю сообщение об ошибке «index.handler не определен или не экспортирован»

.

'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();
};

1 Ответ

0 голосов
/ 06 мая 2020

module.exports.handler вместо exports.handler

...