From ac4f902bb95d77c4a0f938a645697c21b1af34f7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 27 Jul 2024 16:40:59 +0300 Subject: [PATCH] electron: Display TypeScript stack traces --- electron.ts | 3 +++ package-lock.json | 13 +++++++++++-- package.json | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/electron.ts b/electron.ts index b57b94901..0f0e03cd0 100644 --- a/electron.ts +++ b/electron.ts @@ -8,6 +8,9 @@ import appIconService from "./src/services/app_icon.js"; import windowService from "./src/services/window.js"; import tray from "./src/services/tray.js"; +import sourceMapSupport from "source-map-support"; +sourceMapSupport.install(); + // Prevent Trilium starting twice on first install and on uninstall for the Windows installer. if ((await import('electron-squirrel-startup')).default) { process.exit(0); diff --git a/package-lock.json b/package-lock.json index a6818fc89..895f87ab2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,6 +74,7 @@ "semver": "^7.6.3", "serve-favicon": "2.5.0", "session-file-store": "1.5.0", + "source-map-support": "^0.5.21", "split.js": "1.6.5", "stream-throttle": "0.1.3", "striptags": "3.2.0", @@ -115,6 +116,7 @@ "@types/semver": "^7.5.8", "@types/serve-favicon": "^2.5.7", "@types/session-file-store": "^1.2.5", + "@types/source-map-support": "^0.5.10", "@types/stream-throttle": "^0.1.4", "@types/tmp": "^0.2.6", "@types/turndown": "^5.0.4", @@ -2656,6 +2658,15 @@ "@types/express-session": "*" } }, + "node_modules/@types/source-map-support": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.5.10.tgz", + "integrity": "sha512-tgVP2H469x9zq34Z0m/fgPewGhg/MLClalNOiPIzQlXrSS2YrKu/xCdSCKnEDwkFha51VKEKB6A9wW26/ZNwzA==", + "dev": true, + "dependencies": { + "source-map": "^0.6.0" + } + }, "node_modules/@types/stream-throttle": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/@types/stream-throttle/-/stream-throttle-0.1.4.tgz", @@ -12613,7 +12624,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -12630,7 +12640,6 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" diff --git a/package.json b/package.json index efde17b6a..27a253255 100644 --- a/package.json +++ b/package.json @@ -112,6 +112,7 @@ "semver": "^7.6.3", "serve-favicon": "2.5.0", "session-file-store": "1.5.0", + "source-map-support": "^0.5.21", "split.js": "1.6.5", "stream-throttle": "0.1.3", "striptags": "3.2.0", @@ -150,6 +151,7 @@ "@types/semver": "^7.5.8", "@types/serve-favicon": "^2.5.7", "@types/session-file-store": "^1.2.5", + "@types/source-map-support": "^0.5.10", "@types/stream-throttle": "^0.1.4", "@types/tmp": "^0.2.6", "@types/turndown": "^5.0.4",