在 oclif 中使用哨兵发送失败

时间:2021-02-09 11:01:32

标签: sentry oclif

以下代码独立工作并发送消息(node filename.js with "style": "module" in package.json)

import * as Sentry from "@sentry/node";

Sentry.init({
   dsn: "http://id@host/number",
});

Sentry.captureMessage('testing sentry 2');

在 oclif 的 run 函数中使用完全相同的函数失败,没有任何消息(在文件顶部导入):

async run(): Promise<void> {
  const { flags } = this.parse(FileName)

  Sentry.init({
    dsn: 'http://id@host/number',
  })

  Sentry.captureMessage('testing sentry 3')
  // further code, runs

如何调试/使其工作(也在 https://forum.sentry.io/t/using-sentry-with-oclif-for-cli/12815https://github.com/oclif/oclif/issues/497 中)?

0 个答案:

没有答案