opentiny / tiny-vue

TinyVue is an enterprise-class UI component library of OpenTiny community, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
https://opentiny.design/tiny-vue
MIT License
1.54k stars 253 forks source link

🐛 [Bug]: Failed to resolve entry for package "@opentiny/vue". and Failed to resolve import "./component.js" from "....\packages\theme\src\theme\smb-theme\index.js". Does the file exist? #1871

Open Snnerney opened 1 month ago

Snnerney commented 1 month ago

Version

@opentiny/vue@3.17.0

Vue Version

vue@3.4.37

Link to minimal reproduction

[ERROR] Failed to resolve entry for package "@opentiny/vue". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

src/main.ts:5:24:
  5 │ import { Loading } from '@opentiny/vue'

[vite] Internal server error: Failed to resolve import "./component.js" from "....\packages\theme\src\theme\smb-theme\index.js". Does the file exist? Plugin: vite:import-analysis File: D:/download-browser/tiny-vue-dev1/tiny-vue-dev/packages/theme/src/theme/smb-theme/index.js:454:16 452| } 453| 454| export * from './component.js' | ^ 455| 屏幕截图 2024-08-09 131434

Step to reproduce

从github上拉取dev分支代码进行pnpm i拉取依赖,使用pnpm dev运行出现以上错误

What is expected

No response

What is actually happening

[ERROR] Failed to resolve entry for package "@opentiny/vue". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

src/main.ts:5:24:
  5 │ import { Loading } from '@opentiny/vue'

[vite] Internal server error: Failed to resolve import "./component.js" from "....\packages\theme\src\theme\smb-theme\index.js". Does the file exist? Plugin: vite:import-analysis File: D:/download-browser/tiny-vue-dev1/tiny-vue-dev/packages/theme/src/theme/smb-theme/index.js:454:16 452| } 453| 454| export * from './component.js' | ^ 455| 屏幕截图 2024-08-09 131434

What is your project name

Tinyvue

Any additional comments (optional)

No response

kagol commented 1 month ago

@Noospic pnpm dev 命令实际执行了三个命令:

"dev": "pnpm build:entry && gulp themeConcat -w & pnpm -C examples/vue3 dev",

看你的报错应该是第二个生成主题文件的命令执行报错了,可以尝试单独执行该命令:

gulp themeConcat -w
Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


@Noospic The pnpm dev command actually executes three commands:

"dev": "pnpm build:entry && gulp themeConcat -w & pnpm -C examples/vue3 dev",

It seems that your error report is caused by the second command to generate the theme file. You can try to execute this command separately:

gulp themeConcat -w