-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error using v8 lambda layer (243) #12089
Comments
Hey @JoaquinFernandez thanks for reporting (again)! We'll look into this tomorrow. Sorry for the prolonged trouble |
Quick update: We tracked this down to a build issue with the lambda layer specifically. We're currently investigating how to fix it. As a workaround (while definitely not optimal), you can set up the SDK via an NPM package instead of the layer. I just tested this locally and on AWS |
Update before the weekend: We're still not sure what exactly is broken; lest how to fix that but we narrowed it down a bit. I'm gonna document my findings here for some more context and I'll pick this up on Tuesday again (Monday is a holiday here 🙃). WorkaroundsWe fully recognize this is not ideal but there are two workarounds: Using v7 of the Lambda layerWe just re-published the most recent v7 version of our AWS lambda layer. It got a new name (which is why the number starts at 1 again) but apart from that it can be used exactly like the layer up to version 235.
NODE_OPTIONS="-r @sentry/serverless/dist/awslambda-auto" Using v8 via the
|
Hey @JoaquinFernandez some updates on this: I opened two PRs today
Once this is released (probably today or tomorrow), the lambda layer should be usable again 🤞 |
…ddle` (#12233) Our lambda layer relies on one bundled Sentry SDK, which caused problems raised in #12089 and #12009 (comment). Specifically, by bundling `import-in-the-middle` code into one file, it seems like the library's way of declaring its exports conflict, causing the "ImportInTheMiddle is not a constructor" error to be thrown. While this should ideally be fixed soon in `import-in-the-middle`, for now this patch adds a small Rollup plugin to transform `new ImportInTheMiddle(...)` calls to `new ImportInTheMiddle.default(...)` to our AWS Lambda Layer bundle config.
Fixes released with https://github.com/getsentry/sentry-javascript/releases/tag/8.5.0 - please give it a try! |
I can confirm it works now. Thank you! |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/aws-serverless
SDK Version
8.2.1
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
Load the lambda layer 243 and initialize as documented
-r @sentry/aws-serverless/awslambda-auto
Expected Result
Sentry is imported and initialized as expected
Actual Result
The text was updated successfully, but these errors were encountered: