electron - 无法在 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'
})
],
...
解决方案
您正在产生本机崩溃,您在这里看到的是一个符号化的 C++ 堆栈跟踪。尝试throw new Error('test');
在某个地方使用 JavaScript,然后您应该会看到 JS 堆栈跟踪。
推荐阅读
- c++ - Qt/QML/OpenGL:Z-ordering 不适用于 QML 下带有 OpenGL 的半透明项目
- r - 仅通过第一个单词查找两个数据帧之间的匹配行
- javascript - JavaScript 类函数可以添加到 ul,但要清除时未定义
- python - 以下函数在打印我正在寻找的结果时返回“none”。为什么是这样?
- django - Django 和汇总孙子记录
- typescript - 打字稿文件命名约定
- sql-server - 具有可选输出的存储过程
- spring - 在 AWS Lambda 中运行时,Dagger 与 Guice 或 Spring 相比要快多少?
- swift - 以编程方式添加标签栏标题和图标 Swift
- javascript - 如何确保功能与承诺继续执行