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 (将#修改为@)