electron-vite / electron-vite-vue

🥳 Really simple Electron + Vite + Vue boilerplate.
https://electron-vite.github.io
MIT License
4.16k stars 543 forks source link

[Bug] npm run build error #500

Open AnkerLeng opened 2 months ago

AnkerLeng commented 2 months ago

\electron-vite-project\node_modules\vue-tsc\bin\vue-tsc.js:68 throw err; ^ Search string not found: "for (const existingRoot of buildInfoVersionMap.roots) {" (Use node --trace-uncaught ... to show where the exception was thrown)

Node.js v20.15.0

bsneric commented 1 month ago

确实是个 Bug,我在 MacOS 上也有这样的问题,Windows 还没试过,开发人员计划什么时候解决呢?

speauty commented 1 month ago

确实是个 Bug,我在 MacOS 上也有这样的问题,Windows 还没试过,开发人员计划什么时候解决呢?

我也遇到了,跟踪到代码,好像是对高版本ts的兼容处理,在node_modules\vue-tsc\bin\vue-tsc.js里面,然后我就不知道怎么处理了,才接触electron,有点懵,直接删了吗?

RSS1102 commented 1 month ago

@speauty 能提供最小复现吗?

speauty commented 1 month ago

@speauty 能提供最小复现吗?

最小复现?typescript版本5.5.4,然后vue-tsc版本1.8.27,我看了node_modules\typescript\lib\tsc.js里面确实找不到node_modules\vue-tsc\bin\vue-tsc.js指定替换的相关字符串"for (const existingRoot of buildInfoVersionMap.roots) {",在tsc.js里面检索buildInfoVersionMap.roots倒是有两个记录。npm create vite@latest才安装的electron-vue,win环境,Node.js v20.11.1。

speauty commented 1 month ago

image 应该就是这两个包。。。在一起,有毒吧

RSS1102 commented 1 month ago

可能是vue-tsc对于最新版typescript版本处理的问题,你可以多尝试几个版本(可以切换比较旧的typescript版本),或者在 language-tools查找是否有相关的问题。

speauty commented 1 month ago

可能是vue-tsc对于最新版typescript版本处理的问题,你可以多尝试几个版本(可以切换比较旧的typescript版本),或者在 language-tools查找是否有相关的问题。

已经解决。vue-tsc直接更新到最新版本(2.0.28)即可,https://github.com/vuejs/language-tools/blob/master/packages/tsc/package.json