renderer 里使用 @huggingface/transformers 的时候,会报下面的错误(v1,v2 都试过),单独使用 vite 的项目是没问题的
Failed to resolve entry for package "/Users/xxx/Dev/transformers/node_modules/.vite/deps". The package may have incorrect main/module/exports specified in its package.json.
20:06:07 [vite] Internal server error: Failed to resolve entry for package "/Users/xxx/Dev/transformers/node_modules/.vite/deps". The package may have incorrect main/module/exports specified in its package.json.
Plugin: vite:asset-import-meta-url
File: /Users/xxx/Dev/transformers/node_modules/.vite/deps/@huggingface_transformers.js?v=ae240fe6
at packageEntryFailure (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:28725:11)
at resolvePackageEntry (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:28722:5)
at tryCleanFsResolve (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:28381:28)
at tryFsResolve (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:28328:17)
at TransformContext.transform (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:43235:32)
at Object.transform (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:44352:62)
at async loadAndTransform (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:55026:29)
at async viteTransformMiddleware (file:///Users/xxx/Dev/transformers/node_modules/vite/dist/node/chunks/dep-b2890f90.js:64434:32)
复现步骤
新建个 electron-vite 仓库
安装 @huggingface/transformers
在 renderer 的代码里使用
示例代码
import { RawImage } from '@huggingface/transformers'
RawImage.read()
Describe the bug
renderer 里使用 @huggingface/transformers 的时候,会报下面的错误(v1,v2 都试过),单独使用 vite 的项目是没问题的
复现步骤
@huggingface/transformers
示例代码
Electron-Vite Version
2.3.0/1.0.27
Electron Version
27.0.0
Vite Version
4.4.9
Validations