求助:关于electron的蜜汁报错

252 阅读1分钟

项目采用electron + vue Win10 x64 测试环境下运行时报错:

PS D:\ifly> npm run electron:dev
vite-learn@0.0.0 electron:dev
electron .

(node:23352) UnhandledPromiseRejectionWarning: Error: Invalid package 
..\BaiduNetdisk\module\BrowserEngine\resources\app.asar
    at createError (node:electron/js2c/asar_bundle:2:1870)
    at Object.lstat (node:electron/js2c/asar_bundle:2:4441)
    at node:electron/js2c/asar_bundle:2:4950
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:23352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

一开始以为是电脑中其他electron软件造成的原因,但我每次卸载一个提示的软件都会新冒出一个提示的软件,因此,应该与电脑中已安装的electron软件无关,属于环境相关的报错,但不知如何去修改。

electron程序可以正常启动,但是启动后就会报上面的错误,而且程序运行极卡。

个人认为应该与本机环境有关,或者包的版本有关,具体引发原因未知。

同样的流程已在另一台电脑测试,完美通过,并没有复现以上错误。下面是报错的截图。

另外,程序运行极卡应该与电脑硬件配置无关,本机电脑硬件配置为 5900hx + rx6800m

不知道有没有大佬遇到相同的情况,求解! image.png