alex8088 / electron-vite

Next generation Electron build tooling based on Vite 新一代 Electron 开发构建工具,支持源代码保护
https://electron-vite.org
MIT License
3.19k stars 137 forks source link

Invalid or incompatible cached data (cachedDataRejected) #558

Open qiyaozu opened 1 month ago

qiyaozu commented 1 month ago

Describe the bug

electon version 31.1.0 本地 node version: 20.14.0

使用了bytecodePlugin 在mac上打包加密没问题,在win上打包后,无法打开程序 image

Electron-Vite Version

2.0.0

Electron Version

31.1.0

Vite Version

5.0.12

Validations

alex8088 commented 1 month ago

https://cn.electron-vite.org/guide/troubleshooting#a-javascript-error-occurred-in-the-main-process-error-invaild-or-incompatible-cached-data-cacheddatarejected

qiyaozu commented 1 month ago

image image

alex8088 commented 1 month ago

在Windows上打包吗

alex8088 commented 1 month ago

https://cn.electron-vite.org/guide/source-code-protection#%E5%A4%9A%E5%B9%B3%E5%8F%B0%E6%9E%84%E5%BB%BA

qiyaozu commented 1 month ago

在Windows上打包吗

是的

qiyaozu commented 1 month ago

假如我想打包之前,对主进程的代码进行混淆 该怎么做?

qiyaozu commented 1 month ago

我试试prebuild

qiyaozu commented 1 month ago

我在build之前,对代码进行javascript-obfuscator加密,加密完成后,程序可以正常打开,但是一些方法会找不到

alex8088 commented 1 month ago

使用字节码的情况下,在增加混淆有何意义。不推荐,或者二选一