首页 > 解决方案 > 无法在 Sentry 上获得可读的电子崩溃报告

问题描述

我正在使用 crashReporter 处理我们的电子应用程序中的崩溃并将报告发送到 sentry.io。

目标是查看 JS 的哪一部分导致应用程序崩溃。为了模拟崩溃,我正在做“process.crash()”。要查看源代码跟踪,我正在从其文档中安装哨兵,但源代码从未出现在哨兵中。

下面是 CrashReporter 初始化代码:

   crashReporter.start({
      companyName: '...',
      productName: '...',
      uploadToServer: true,
      submitURL: 'https://....ingest.sentry.io/api/.../minidump/?sentry_key=...'
    });

Sentry 被添加到项目中:

sentry-wizard --integration electron
npm install --save-dev @sentry/cli electron-download
node sentry-symbols.js

网络包配置:

const SentryWebpackPlugin = require('@sentry/webpack-plugin');
var config = {
  target: 'node',
  devtool: 'source-map',
  plugins: [
    new webpack.ProgressPlugin(),
    new webpack.EnvironmentPlugin(),
    new SentryWebpackPlugin({
      include: '.',
      ignoreFile: '.sentrycliignore',
      ignore: ['node_modules', 'webpack.config.js'],
      configFile: 'sentry.properties'
    })
  ],
  ...

但这就是它在哨兵上的样子: 在此处输入图像描述

在此处输入图像描述

标签: electroncrash-reportssentry

解决方案


您正在产生本机崩溃,您在这里看到的是一个符号化的 C++ 堆栈跟踪。尝试throw new Error('test');在某个地方使用 JavaScript,然后您应该会看到 JS 堆栈跟踪。


推荐阅读