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(
9 join(moonlightHost.asarPath, "node_modules", "@sentry", "electron")
10 );
11 require.cache[hostSentryPath] = new Module(
12 hostSentryPath,
13 require.cache[require.resolve(moonlightHost.asarPath)]
14 );
15 require.cache[hostSentryPath]!.exports = {
16 init: () => {},
17 captureException: () => {},
18 setTag: () => {},
19 setUser: () => {}
20 };
21 logger.debug("Stubbed Sentry host side!");
22 } catch (err) {
23 logger.error("Failed to stub Sentry host side:", err);
24 }
25}