Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/aws-serverless
SDK Version
8.7.0
Framework Version
@sentry/aws-serverless
Link to Sentry event
No response
SDK Setup
import * as Sentry from '@sentry/aws-serverless';
Sentry.init({
dsn: "SENTRY_DSN_HERE",
// Add Performance Monitoring by setting tracesSampleRate and adding integration
// Set tracesSampleRate to 1.0 to capture 100% of transactions
// We recommend adjusting this value in production
tracesSampleRate: 1.0,
});
Steps to Reproduce
We tried the full combination set of these steps.
- Set up the λ layers
We tried these two ARNs
arn:aws:lambda:us-west-2:943013980633:layer:SentryNodeServerlessSDK:247
arn:aws:lambda:us-west-2:943013980633:layer:SentryNodeServerlessSDKv7:1
We also manually built a layer and pushed it to the λ
- Set the env variables
We tried these env vars
SENTRY_DSN='SENTRY_DSN'
SENTRY_TRACES_SAMPLE_RATE=1
These four variations of NODE_OPTIONS
:
NODE_OPTIONS='-r @sentry/serverless/dist/awslambda-auto'
NODE_OPTIONS='-r @sentry/serverless/awslambda-auto'
NODE_OPTIONS='-r @sentry/aws-serverless/build/npm/cjs/awslambda-auto'
not setting NODE_OPTIONS
It might be relevant that our file is .mjs
file.
We are only noting the relevant errors in the Actual Result section.
Expected Result
Sentry logs something.
Actual Result
For the v7 arn & node options with dist in it:
Cannot find package '@sentry/aws-serverless' imported from /var/task/index.mjs
For the v7 arn & node options without dist in it:
Error: Cannot find module '@sentry/serverless/awslambda-auto'
For the arn we got from the docs & node options with dist
in it:
Error: Cannot find module '@sentry/serverless/dist/awslambda-auto'
For the arn we got from the docs & node options without dist
in it:
Error: Cannot find module '@sentry/serverless/awslambda-auto'
For the arn we got from the docs & node options with cjs
in it:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './build/npm/cjs/awslambda-auto' is not defined by "exports" in /opt/nodejs/node_modules/@sentry/aws-serverless/package.json
Also, since the official docs for loading the layer didn't specify setting NODE_OPTIONS, we also tried that:
Cannot find package '@sentry/aws-serverless' imported from /var/task/index.mjs\nDid you mean to import \"@sentry/aws-serverless/build/npm/cjs/index.js\"
Metadata
Metadata
Assignees
Type
Projects
Status