From 98621d0c6d2fd7539b7d8b35a28eb5183d8a8f76 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 16 May 2024 16:56:23 +0200 Subject: [PATCH 1/3] fix(nestjs): Broaden nest.js type (#12076) Let's see.. --- packages/node/src/integrations/tracing/nest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node/src/integrations/tracing/nest.ts b/packages/node/src/integrations/tracing/nest.ts index a831a6771179..c1a4b9e7a3c0 100644 --- a/packages/node/src/integrations/tracing/nest.ts +++ b/packages/node/src/integrations/tracing/nest.ts @@ -28,7 +28,7 @@ interface NestJsErrorFilter { interface MinimalNestJsApp { useGlobalFilters: (arg0: NestJsErrorFilter) => void; useGlobalInterceptors: (interceptor: { - intercept: (context: MinimalNestJsExecutionContext, next: { handle: () => void }) => void; + intercept: (context: MinimalNestJsExecutionContext, next: { handle: () => any }) => any; }) => void; } From 7ce2f20715518fd963939e67da4c82afd58da0fe Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 16 May 2024 17:38:49 +0200 Subject: [PATCH 2/3] fix(aws-serverless): Fix build of lambda layer (#12083) We previously adjusted our lambda layer auto initialization in https://github.com/getsentry/sentry-javascript/pull/12017. This unfortunately changed the build output of the `awslambda-auto` bootstrapping script which required a package that isn't included in the layer (`@sentry/node`). This PR fixes the `awslambda-auto` file; local testing showed no more imports from `@sentry/node`. fixes https://github.com/getsentry/sentry-javascript/issues/12074 --- packages/aws-serverless/rollup.aws.config.mjs | 1 + packages/aws-serverless/src/awslambda-auto.ts | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/aws-serverless/rollup.aws.config.mjs b/packages/aws-serverless/rollup.aws.config.mjs index 22656f397140..6f5cc7d581e5 100644 --- a/packages/aws-serverless/rollup.aws.config.mjs +++ b/packages/aws-serverless/rollup.aws.config.mjs @@ -15,6 +15,7 @@ export default [ sourcemap: false, }, }, + preserveModules: false, }), // We only need one copy of the SDK, and we pick the minified one because there's a cap on how big a lambda function // plus its dependencies can be, and we might as well take up as little of that space as is necessary. We'll rename diff --git a/packages/aws-serverless/src/awslambda-auto.ts b/packages/aws-serverless/src/awslambda-auto.ts index 6deb405ba505..9cf3ba68ae6e 100644 --- a/packages/aws-serverless/src/awslambda-auto.ts +++ b/packages/aws-serverless/src/awslambda-auto.ts @@ -1,5 +1,4 @@ -import { getDefaultIntegrations as getNodeDefaultIntegrations } from '@sentry/node'; -import { init, tryPatchHandler } from './sdk'; +import * as Sentry from './index'; const lambdaTaskRoot = process.env.LAMBDA_TASK_ROOT; if (lambdaTaskRoot) { @@ -8,12 +7,12 @@ if (lambdaTaskRoot) { throw Error(`LAMBDA_TASK_ROOT is non-empty(${lambdaTaskRoot}) but _HANDLER is not set`); } - init({ + Sentry.init({ // We want to load the performance integrations here, if the tracesSampleRate is set for the layer in env vars // Sentry node's `getDefaultIntegrations` will load them if tracing is enabled, // which is the case if `tracesSampleRate` is set. // We can safely add all the node default integrations - integrations: getNodeDefaultIntegrations( + integrations: Sentry.getDefaultIntegrations( process.env.SENTRY_TRACES_SAMPLE_RATE ? { tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE), @@ -22,7 +21,7 @@ if (lambdaTaskRoot) { ), }); - tryPatchHandler(lambdaTaskRoot, handlerString); + Sentry.tryPatchHandler(lambdaTaskRoot, handlerString); } else { throw Error('LAMBDA_TASK_ROOT environment variable is not set'); } From aacb33a9b607cf68ffb0ca186bef7eb4d4afea01 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 16 May 2024 17:40:18 +0200 Subject: [PATCH 3/3] meta: Update CHANGELOG for 8.2.1 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fe7286ed88d..2ee1edd5991c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott +## 8.2.1 + +- fix(aws-serverless): Fix build of lambda layer (#12083) +- fix(nestjs): Broaden nest.js type (#12076) + ## 8.2.0 - feat(redis-cache): Create cache-span with prefixed keys (get/set commands) (#12070)