Add process.type to be used by Sentry

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen committed 2021-07-08 10:37:46 +03:00
1 parent 1bf6f5a94e
commit 6eced04c76
3 files changed
+27 -1

No files matched your search

+19
View File
@@ -36,6 +36,25 @@ import { registerIpcHandlers } from "./ipc";
import { ipcRenderer } from "electron";
import { IpcRendererNavigationEvents } from "./navigation/events";
import { catalogEntityRegistry } from "./api/catalog-entity-registry";
import { dsn } from "../common/vars";
import { CaptureConsole, Dedupe, Offline } from "@sentry/integrations";
// Initializing Sentry
const Sentry =
// prevent `TypeError: mod.require is not a function`
// see https://docs.sentry.io/platforms/javascript/guides/electron/#webpack-configuration
process.type === "main"
? require("@sentry/electron/dist/main")
: require("@sentry/electron/dist/renderer");
Sentry.init({
dsn,
integrations: [
new CaptureConsole({ levels: ["error"] }),
new Dedupe(),
new Offline()
],
});
@observer
export class LensApp extends React.Component {