AWS Lambda Function is returning “Cannot find module 'index'” yet the handler in the config is set to index

后端 未结 7 1107
青春惊慌失措
青春惊慌失措 2021-01-31 15:51

As my title explains I am getting the following error:

 {
  \"errorMessage\": \"Cannot find module \'index\'\",
  \"errorType\": \"Error\",
  \"stackTrace\": [
          


        
7条回答
  •  日久生厌
    2021-01-31 16:44

    The problem occurs when the handler cannot be located in the zip at first level. So anytime you see such error make sure that the file is at the first level in the exploded folder.

    To fix this zip the files and not the folder that has the files.

提交回复
热议问题