微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Runtime.HandlerNotFound :: Node js 14 :: AWS LAMBDA

如何解决Runtime.HandlerNotFound :: Node js 14 :: AWS LAMBDA

我的运行时设置指示“index.handler”作为要调用的“Handler”, 但是得到这个错误。 我哪里出错了?[在此处输入图片描述][1]

执行结果:

test

Response
{
  "errorType": "Runtime.HandlerNotFound","errorMessage": "index.handler is undefined or not exported","trace": [
    "Runtime.HandlerNotFound: index.handler is undefined or not exported","    at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)","    at Object.<anonymous> (/var/runtime/index.js:43:30)","    at Module._compile (internal/modules/cjs/loader.js:1063:30)","    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)","    at Module.load (internal/modules/cjs/loader.js:928:32)","    at Function.Module._load (internal/modules/cjs/loader.js:769:14)","    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)","    at internal/main/run_main_module.js:17:47"
  ]
}

Function Logs
START RequestId: 7dca2129-ebb8-4241-969f-91b7c3c4a08c Version: $LATEST
2021-05-22T16:24:17.126Z    undefined   ERROR   Uncaught Exception  {"errorType":"Runtime.HandlerNotFound","errorMessage":"index.handler is undefined or not exported","stack":["Runtime.HandlerNotFound: index.handler is undefined or not exported","    at internal/main/run_main_module.js:17:47"]}
2021-05-22T16:24:17.145Z    undefined   ERROR   (node:9) Warning: Accessing non-existent property 'handler' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)

index.js :

exports.handler =  async function(event,context) {
  console.log("Hello ...");
  return "hey";
}

运行时设置的图像: https://i.stack.imgur.com/TGeO3.png

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。