You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exports.handler=asyncfunction(event,context){letbody=parse(event.body)awaitdoSomeAsyncWorkHere();return{statusCode: 301,// oops no body}}
you get this:
(node:26997) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string or Buffer. Received type undefined
at write_ (_http_outgoing.js:607:11)
at ServerResponse.write (_http_outgoing.js:579:10)
at callback (/Users/.../node_modules/netlify-lambda/lib/serve.js:26:14)
at /Users/.../node_modules/netlify-lambda/lib/serve.js:41:21
at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:26997) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26997) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hash: ec967454cf2cf833f214
splitting out @waynehoover's issue from here: #43 (comment)
when you do this:
you get this:
we should basically insert an undefined check here: https://github.com/netlify/netlify-lambda/blob/master/lib/serve.js#L29 and serve a friendly warning
should also thinking about other forms of validation
The text was updated successfully, but these errors were encountered: