Skip to content

Cannot read property 'finish' of undefined #2984

Closed
@felipedumer

Description

@felipedumer
  • @sentry/serverless": "^5.26.0

Version:

5.26.0

Description

0

Good afternoon,

After new release:
The sentry service works, But I'm getting this message in Amazon CloudWatch:

ERROR   Invoke Error    
{
    "errorType": "TypeError",
    "errorMessage": "Cannot read property 'finish' of undefined",
    "stack": [
        "TypeError: Cannot read property 'finish' of undefined",
        "    at Runtime.eval [as handler] (webpack://rpc-analise-input/./node_modules/@sentry/serverless/esm/awslambda.js?:216:25)",
        "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
    ]
}

Sentry common file

import * as sentry from '@sentry/serverless';

sentry.AWSLambda.init({dsn: 'https://somedsn',
});

export default sentry;

Lambda file

import sentry from '../common/sentry';

const handler = async (event) => {}

exports.handler = sentry.AWSLambda.wrapHandler(handler);

Error location

const transaction = startTransaction({
            name: context.functionName,
            op: 'awslambda.handler',
        });

Line 170: transaction.finish();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: serverlessIssues related to the Sentry Serverless SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions