I Configured the API Endpoint. After that I was following the test section immediately following.
Mkdir mocks
Create a mocks/create-event.json
I created the file in the mocks directory
When I run the following
$ serverless invoke local --function create --path
mocks/create-event.json
Expected Result:
{
statusCode: 200,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': true
},
body: '{"userId":"USER-SUB-1234","noteId":"578eb840-
f70f-11e6-9d1a-1359b3b22944","content":"hello
world","attachment":"hello.jpg","createdAt":1487800950620}'
}
Actual Result:
Serverless: DOTENV: Loading environment variables from .env:
Serverless: - SLS_DEBUG
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Load command dev
Serverless: Invoke invoke:local
Serverless: Invoke webpack:validate
Serverless: Invoke webpack:compile
Serverless: Bundling with Webpack...
Type Error ---------------------------------------------
TypeError: Cannot read property 'v1' of undefined
Your Environment Information ---------------------------
Operating System: linux
Node Version: 12.16.1
Framework Version: 1.67.0
Plugin Version: 3.6.1
SDK Version: 2.3.0
Components Version: 2.22.3