Hey all, I'm getting this deprecated error: ```E...
# help
Hey all, I'm getting this deprecated error:
Copy code
ERROR	(node:9) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
This happens because one of my dependencies use the deprecated Buffer (I don't know which dependencies...), and even though this error only shows up if Buffer() is used outside of node_modules, SST bundles my project, meaning my dependencies code is outside of node_modules, hence this error occurs I think. Does anyone else have this problem? Because of this, I'm constantly getting HTTP 500 when I call my API. I'm trying to disable this error but to no avail...
Hey @Jack Tan, I didn’t Buffer() deprecation is an ERROR, thought it was a WARNING.
Can you look at the lock file and see which package is including it?
or do a
npm ls
Thanks @Frank I'm using
but I assumed
yarn why buffer
which uses
which uses
which also uses
I thought it's a warning too but I think it use
. The problem is, when I run SST locally, it return the status code as 200 as seen on the screenshot, then the lambda function disconnected. If I don't run it locally, the only "error" I get is this
deprecated problem as seen here in Cloudwatch
I can't even catch this error inside my
try catch
This is the code that is causing this issue, I don't see anything wrong with it... It's really weird.. Is there a way to run
node *
--pending-deprecation`* ` but for SST?
Okay this is annoying, I added `then(async (response) =>`and the warning is gone...
@Frank it’s weird that this warning kills request locally right?
hmm I think the issue might not be related to the buffer
Usually the
Failed to send response
error happens when the Lambda request took long to respond, and the actually Lambda function timed out already.
@Jack Tan What are you setting the function timeout to? Can you try increasing it to ie. 20s?
I increased the timeout to 20s, still got
Failed to send response
error, even though locally my Lambda returned 200
the error is back 😞
There's no way to add
node --pending-deprecation
? @Frank @Jay
Copy code
a50278bb-47fb-43e3-9614-44e4cb116f77 REQUEST dev-papermind-email-servi-EmailServiceLambdaPOSTem-5tJmN6G4OxxU [src/sendSignatureIsSignedEmail.handler] invoked by API POST /email/signature/send

a50278bb-47fb-43e3-9614-44e4cb116f77 RESPONSE {"statusCode":200,"headers":{"Content-Type":"text/plain","Access-Control-Allow-Origin":"<http://localhost:3000>"},"body":"Signature is signed email sent."}

a50278bb-47fb-43e3-9614-44e4cb116f77-1645583574288 Failed to send response because the Lambda function is disconnected
The response is there.. This is a huge blocker at work atm..
Hey @Jack Tan, can you send me ur
Just leaving a note here. The issue was indeed the Lambda taking long to run. It worked after setting timeout to 30s.