找不到模块“unplugin-auto-import/vite”或其相应的类型声明。
bug
### Describe the bug
v20.3.0。开发Electron项目。在官网下载的electron模版。然后下载unplugin/unplugin-auto-import 导入到electron.vite.config.ts中报错。不影响代码执行。我降级到20.0.0时,报错消失。
TypeScript:^5.3.3
Vite:^5.0.12
### Reproduction
找不到模块“unplugin-auto-import/vite”或其相应的类型声明。 “/Users/longjunjie/project/electron-xiaoluxian/node_modules/unplugin-auto-import/dist/vite.d.mts”处有类型,但无法在当前 "moduleResolution" 设置下解析此结果。请考虑更新到 "node16"、"nodenext" 或 "bundler"。
### System Info
```Shell
Mac,芯片m3pro
```
### Used Package Manager
npm
### Validations
- [x] Follow our [Code of Conduct](https://github.com/antfu/.github/blob/main/CODE_OF_CONDUCT.md)
- [x] Read the [Contributing Guide](https://github.com/antfu/contribute).
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [x] The provided reproduction is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
关闭于 2026-01-14 2 条评论