Hey guys, I'm trying to use the wrapper for a lamb...
# sst
o
Hey guys, I'm trying to use the wrapper for a lambda function provided by Sentry (Sentry.AWSLambda.wrapHandler), but I am getting the following error:
Copy code
name: 'TypeError',
 message: 'context.getRemainingTimeInMillis is not a function',
 stack: 'TypeError: context.getRemainingTimeInMillis is not a function\n' +
it looks like the context object which is sent to the handler function does not implement the Context interface. Does it makes sense to add a basic
getRemainingTimeInMillis
method that returns a constant number to ensure that the context object conforms to the interface or there is a better way to solve this issue?
f
Hi @Oleksii, Right On! Yeah, can you open up
node_modules/@serverless-stack/cli/assets/lambda-invoke/bootstrap.js
and below the
context.done
line add something like
Copy code
context.getRemainingTimeInMillis = () => 1000;
If that works, I will implement it properly and cut a release.
Let me know!
o
that is exactly what i did while testing it locally a few hours ago😅
Copy code
context.getRemainingTimeInMillis = () => 3;
it worked
f
Got it.
o
@Frank do you think it will be possible to merge required changes today?
f
Yup should be able to. I will keep you posted
Fixed in v0.9.8
To update:
Copy code
$ npm install --save --save-exact @serverless-stack/cli@0.9.8 @serverless-stack/resources@0.9.8
o
@Frank thanks a lot!