Skip to content

@sentry/serverless  #7421

Closed
Closed
@revmischa

Description

@revmischa

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/serverless

SDK Version

7.42.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

import { AWSLambda } from '@sentry/serverless';
import { Handler } from 'aws-lambda';
import { getSstStage } from 'common';

if (process.env['_HANDLER']) {
  AWSLambda.init({
    environment: getSstStage(),
    maxBreadcrumbs: 30,
    debug: false,
  });
}

export function wrapSentry(fn: Handler) {
  return AWSLambda.wrapHandler(fn);
}

const handler = middy(wrapSentry(resolverFunc))

Steps to Reproduce

Wrap a handler in the latest sentry/serverless AWSLambda.wrapHandler
I'm using appSync resolver lambda functions

Expected Result

Don't throw this error 👇🏻 when I invoke the function

Actual Result

TypeError: Cannot assign to read only property 'get' of object '[object Module]'
    at fill (/node_modules/.pnpm/@sentry+utils@7.42.0/node_modules/@sentry/src/object.ts:39:1)
    at Http.setupOnce (/node_modules/.pnpm/@sentry+node@7.42.0/node_modules/@sentry/src/integrations/http.ts:105:1)
    at setupIntegration (/node_modules/.pnpm/@sentry+core@7.42.0/node_modules/@sentry/src/integration.ts:105:1)
    at <anonymous> (/node_modules/.pnpm/@sentry+core@7.42.0/node_modules/@sentry/src/integration.ts:93:1)
    at Array.forEach (<anonymous>)
    at setupIntegrations (/node_modules/.pnpm/@sentry+core@7.42.0/node_modules/@sentry/src/integration.ts:90:1)
    at NodeClient.setupIntegrations (/node_modules/.pnpm/@sentry+core@7.42.0/node_modules/@sentry/src/baseclient.ts:273:1)
    at Hub.bindClient (/node_modules/.pnpm/@sentry+core@7.42.0/node_modules/@sentry/src/hub.ts:124:1)
    at initAndBind (/node_modules/.pnpm/@sentry+core@7.42.0/node_modules/@sentry/src/sdk.ts:36:1)
    at init (/node_modules/.pnpm/@sentry+node@7.42.0/node_modules/@sentry/src/sdk.ts:170:1)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions