this repo has no description
1import { join } from "node:path";
2import { Module } from "node:module";
3
4const logger = moonlightHost.getLogger("disableSentry");
5
6if (moonlightHost.asarPath !== "moonlightDesktop") {
7 try {
8 const hostSentryPath = require.resolve(join(moonlightHost.asarPath, "node_modules", "@sentry", "electron"));
9 require.cache[hostSentryPath] = new Module(hostSentryPath, require.cache[require.resolve(moonlightHost.asarPath)]);
10 require.cache[hostSentryPath]!.exports = {
11 init: () => {},
12 captureException: () => {},
13 setTag: () => {},
14 setUser: () => {},
15 captureMessage: () => {}
16 };
17 logger.debug("Stubbed Sentry host side!");
18 } catch (err) {
19 logger.error("Failed to stub Sentry host side:", err);
20 }
21}