-
Notifications
You must be signed in to change notification settings - Fork 675
Closed
Labels
Description
We use res.sendStatus(200)
in SQS handlers and that started to trigger the following error with minor upgrade of the package.
{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "SyntaxError: Unexpected token 'O', \"OK\" is not valid JSON",
"reason": {
"errorType": "SyntaxError",
"errorMessage": "Unexpected token 'O', \"OK\" is not valid JSON",
"stack": [
"SyntaxError: Unexpected token 'O', \"OK\" is not valid JSON",
" at JSON.parse (<anonymous>)",
" at Object.getResponseToSqs [as getResponse] (/opt/nodejs/node_modules/@codegenie/serverless-express/src/event-sources/aws/sqs.js:13:45)",
" at forwardResponse (/opt/nodejs/node_modules/@codegenie/serverless-express/src/transport.js:33:39)",
" at forwardRequestToNodeServer (/opt/nodejs/node_modules/@codegenie/serverless-express/src/transport.js:160:3)",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
]
},
"promise": {},
"stack": [
"Runtime.UnhandledPromiseRejection: SyntaxError: Unexpected token 'O', \"OK\" is not valid JSON",
" at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)",
" at process.emit (node:events:518:28)",
" at emit (node:internal/process/promises:150:20)",
" at processPromiseRejections (node:internal/process/promises:284:27)",
" at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"
]
}
In case of res.sendStatus(204)
the error message is SyntaxError: Unexpected end of JSON input
.
I think it's related to #628.