【问题标题】:errorType": "Runtime.HandlerNotFound" for AWS Lambda functionerrorType”:AWS Lambda 函数的“Runtime.HandlerNotFound”
【发布时间】:2020-08-21 07:56:49
【问题描述】:

我在测试我的 Lambda 函数时发现了这个错误。我在 index.js 中给出了 export.handler 函数,但仍然收到错误消息“index.handler is undefined or not export”

.

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

【问题讨论】:

    标签: amazon-web-services aws-lambda


    【解决方案1】:

    module.exports.handler 而不是exports.handler

    【讨论】:

      猜你喜欢
      • 2020-09-03
      • 2021-10-11
      • 1970-01-01
      • 2020-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-23
      相关资源
      最近更新 更多