electron 在preload加载crash模块的时候报错 Unable to load preload script SyntaxError: Unexpected token *
经分析import
is indeed part of ES6 所以如果需要争取预加载carsh模块。可以把import改用require需要如下使用
const {init} = require('@sentry/electron')
const {crashReporter} = require('electron')
// 报告常规错误
init({
dsn: 'url'
})
// 报告系统错误
crashReporter.start({
companyName: 'companyName',
productName: 'productName',
ignoreSystemCrashHandler: true,
submitURL: 'url'
})