diff --git a/electron.vite.config.ts b/electron.vite.config.ts index c189525b462..391ff4003ee 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -9,7 +9,7 @@ export default defineConfig({ // However, until we use ESM for electron main, we need to include ESM-only deps in the bundle: (exclude from externalize) plugins: [externalizeDepsPlugin({ exclude: ['p-map', 'execa', 'nanoid', 'file-type'] })], build: { - target: 'node20.14', + target: 'node20.18', sourcemap: true, }, }, @@ -17,14 +17,14 @@ export default defineConfig({ // https://electron-vite.org/guide/dev#dependencies-vs-devdependencies plugins: [externalizeDepsPlugin({ exclude: [] })], build: { - target: 'node20.14', + target: 'node20.18', sourcemap: true, }, }, renderer: { plugins: [react()], build: { - target: 'chrome126', + target: 'chrome130', sourcemap: true, chunkSizeWarningLimit: 3e6, }, diff --git a/package.json b/package.json index d3afb0d4b07..037a1ff0da0 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "csv-parse": "^4.15.3", "csv-stringify": "^5.6.2", "data-uri-to-buffer": "^4.0.0", - "electron": "^31.3.1", + "electron": "^33.2.1", "electron-builder": "^24.13.3", "electron-devtools-installer": "^3.2.0", "electron-vite": "^2.3.0", diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 4a7ff7942ce..3c9e3ddcae2 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -2281,7 +2281,7 @@ function App() { ev.preventDefault(); if (!ev.dataTransfer) return; const { files } = ev.dataTransfer; - const filePaths = [...files].map((f) => f.path); + const filePaths = [...files].map((f) => electron.webUtils.getPathForFile(f)); focusWindow(); diff --git a/src/renderer/src/TopMenu.tsx b/src/renderer/src/TopMenu.tsx index fa905b4cb61..f606a88004b 100644 --- a/src/renderer/src/TopMenu.tsx +++ b/src/renderer/src/TopMenu.tsx @@ -14,6 +14,7 @@ import { InverseCutSegment } from './types'; const { stat } = window.require('fs/promises'); +const { webUtils } = window.require('electron'); const outFmtStyle = { height: 20, maxWidth: 100 }; const exportModeStyle = { flexGrow: 0, flexBasis: 140 }; @@ -63,7 +64,7 @@ function TopMenu({ async function onDrop(ev: DragEvent) { ev.preventDefault(); if (!ev.dataTransfer) return; - const paths = [...ev.dataTransfer.files].map((f) => f.path); + const paths = [...ev.dataTransfer.files].map((f) => webUtils.getPathForFile(f)); const [firstPath] = paths; if (paths.length === 1 && firstPath && (await stat(firstPath)).isDirectory()) { setCustomOutDir(firstPath); diff --git a/yarn.lock b/yarn.lock index c9e5676a2d2..56c6d45f456 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4534,16 +4534,16 @@ __metadata: languageName: node linkType: hard -"electron@npm:^31.3.1": - version: 31.3.1 - resolution: "electron@npm:31.3.1" +"electron@npm:^33.2.1": + version: 33.2.1 + resolution: "electron@npm:33.2.1" dependencies: "@electron/get": "npm:^2.0.0" "@types/node": "npm:^20.9.0" extract-zip: "npm:^2.0.1" bin: electron: cli.js - checksum: 10/bc6e582c2a6ad9a95eeff71a24b2f798b88ce33dae1cae9e02fcb81f058463c502210a8eb0b9a061c82223060159ac69c141386f689ce2f52818f96fefc827c9 + checksum: 10/1f7e4e61fe949503a79e08c91fc6a914216868176907b0586c4d47a720f0d16c42cb0594f30efa0608c316e992426befc0b6b214702bf1c4e2bd77115959efec languageName: node linkType: hard @@ -7633,7 +7633,7 @@ __metadata: csv-stringify: "npm:^5.6.2" cue-parser: "npm:^0.3.0" data-uri-to-buffer: "npm:^4.0.0" - electron: "npm:^31.3.1" + electron: "npm:^33.2.1" electron-builder: "npm:^24.13.3" electron-devtools-installer: "npm:^3.2.0" electron-store: "npm:5.1.1"