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
Actually, @sentry/serverless package use the aws-sdk v2. It results on this warnings when testing in local with serverless-offline :
(node:49034) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
With lambdas using the node18 runtime, the sdk available is the v3, not the v2. To be able to use the sdk in v2, it must be included in the package, which makes the size of each lambdas quite substantial.
Solution Brainstorm
Use the sdk v3. But, with that, we have the problem of compatibility between aws node runtime < node18 using the sdk v2 and aws node runtime >= node18 using the sdk v3
Reacted by João Dias, Alden Quimby, Chathura Alwis and Andrew
Sounds like we can't upgrade to the v3 SDK at the moment without dropping support for Node <18 on AWS Lambda. So we can't do this without releasing a major and even then it partially goes against our philosophy of supporting old runtimes as long as possible. On the other hand, I get that this warning is concerning. I'm going to backlog this issue and add it to the "Up for Discussion" tasks for our next major.
You don't need node 18. We are using the new SDK with node 16 and I'm pretty sure it works in node 14 and possibly even earlier versions. There's nothing special about their code
P.S.: anyone that is using the old SDK is already receiving this:
(node:28720) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
You can run analyze of a lambda with or without sentry to saw the difference. And the difference is like I said : with Sentry, we have an import of aws-sdk V2 by this code line :
@throrin19 In your esbuild config you neither marked @sentry/serverless nor aws-sdk as external which is gonna pull everything into your bundle. This is not something we can prevent from within the SDK. This is addressed by configuring your application properly.
I think you don't want understand....If you made it external, it's not included in the lambda.in node 18+, AWS SDK v2 is not included : we have error in usage if we called this.And sentry is never included with your response.
This occured with execution error.The solution is to push them inside a lambda layer but it's not a proper solution and it have a really big problem with the library for now
Activity
Lms24 commentedon Jul 18, 2023
Hi @throrin19 thanks for writing in!
Sounds like we can't upgrade to the v3 SDK at the moment without dropping support for Node <18 on AWS Lambda. So we can't do this without releasing a major and even then it partially goes against our philosophy of supporting old runtimes as long as possible. On the other hand, I get that this warning is concerning. I'm going to backlog this issue and add it to the "Up for Discussion" tasks for our next major.
throrin19 commentedon Jul 18, 2023
Thanks for your response and I fully understand this complex problem
alfaproject commentedon Sep 6, 2023
You don't need node 18. We are using the new SDK with node 16 and I'm pretty sure it works in node 14 and possibly even earlier versions. There's nothing special about their code
P.S.: anyone that is using the old SDK is already receiving this:
58 remaining items
throrin19 commentedon Dec 14, 2023
I created a project with the example here : https://github.com/Aquassay/test-sentry-serverless-aws-sdk
You can run analyze of a lambda with or without sentry to saw the difference. And the difference is like I said : with Sentry, we have an import of aws-sdk V2 by this code line :
sentry-javascript/packages/serverless/src/awsservices.ts
Line 44 in 93bbeb7
This is the analyze without Sentry on the lambda (In my example, in TS with middy) :
And the analyze with Sentry :
lforst commentedon Dec 14, 2023
@throrin19 In your esbuild config you neither marked
@sentry/serverlessnoraws-sdkas external which is gonna pull everything into your bundle. This is not something we can prevent from within the SDK. This is addressed by configuring your application properly.throrin19 commentedon Dec 14, 2023
AbhiPrasad commentedon Apr 22, 2024
Will be released with
8.0.0.