【问题标题】:Sentry serverless - Cannot read property 'finish' of undefinedSentry 无服务器 - 无法读取未定义的属性“完成”
【发布时间】:2021-02-02 15:41:56
【问题描述】:

下午好,

哨兵服务有效,但我在 Amazon CloudWatch 中收到此消息:

我正在使用 serverlress-webpack 编译我的文件,在其他项目中工作正常。

有人知道是什么吗?

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)"
    ]
}

我的哨兵档案:

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

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

export default sentry;

我的 lambda 文件:

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

const handler = async (event) => {}

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

使用 webpack-serverless 编译一切。

问题出现在 node_modules/@sentry/serverless/esm/awslambda.js 上

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

Line 170: transaction.finish();

【问题讨论】:

    标签: javascript node.js amazon-web-services aws-lambda serverless


    【解决方案1】:

    这是 Sentry https://github.com/getsentry/sentry-javascript/issues/2984 特定版本中的错误

    在解决之前,解决方案是降级。

    【讨论】:

      猜你喜欢
      • 2020-10-10
      • 2021-08-11
      • 2021-11-04
      • 2021-04-28
      • 2020-09-03
      • 2020-10-04
      • 1970-01-01
      • 2023-03-26
      • 2022-11-12
      相关资源
      最近更新 更多