我正在尝试使用 SAM(python3.8)构建一个 lambda 函数。我在 VSCode 上安装了 AWS 工具包并创建了 hello_world 函数。SAM 构建成功完成。当我使用预定义的 test/events/event.json运行调用命令时,出现异常:
sam local invoke "TestFunction" -e test/events/event.json
输出:
{"errorMessage": "Unable to unmarshal input: Expecting value: line 1 column 1 (char 0)", "errorType": "Runtime.UnmarshalError", "stackTrace": []}
在没有事件的情况下运行时,该函数不会引发任何错误。
版本:
- SAM CLI,版本 1.23.0
- aws-cli/1.18.69 Python/3.8.5 Linux/5.8.0-53-generic botocore/1.16.19
- Docker 版本 20.10.6,构建 370c289
你能指导我如何解决这个问题吗?