chansee97 / nova-admin

A simple and flexible admin template based on Vue3, Vite, TypeScript, NaiveUI
https://nova-admin.pages.dev/
MIT License
930 stars 159 forks source link

TypeError: (0 , _presetWind.presetWind) is not a function #16

Closed lizihanglove closed 5 months ago

lizihanglove commented 6 months ago

Description

Error appeared when runing pnpm dev as follow:

(base) lizihang@MacBook-Pro nova-admin % pnpm dev

> nova-admin@0.9.0 dev /Users/lizihang/open-source/github/nova-admin
> vite --mode dev --port 9980

error when starting dev server:
TypeError: (0 , _presetWind.presetWind) is not a function
    at /Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/@unocss+preset-uno@0.60.4/node_modules/@unocss/preset-uno/dist/index.mjs:69:43
    at /Users/lizihang/open-source/github/nova-admin/unocss.config.ts:6:35
    at evalModule (/Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/jiti@1.21.1/node_modules/jiti/dist/jiti.js:1:247359)
    at jiti (/Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/jiti@1.21.1/node_modules/jiti/dist/jiti.js:1:245172)
    at loadConfigFile (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/unconfig@0.3.13/node_modules/unconfig/dist/index.mjs:177:13)
    at async Object.load (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/unconfig@0.3.13/node_modules/unconfig/dist/index.mjs:98:24)
    at async loadConfig (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/@unocss+config@0.60.4/node_modules/@unocss/config/dist/index.mjs:43:18)
    at async reloadConfig (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/@unocss+vite@0.60.4_rollup@4.18.0_vite@5.2.12_@types+node@20.14.1_sass@1.77.4_/node_modules/@unocss/vite/dist/index.mjs:93:20)
    at async Object.updateRoot (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/@unocss+vite@0.60.4_rollup@4.18.0_vite@5.2.12_@types+node@20.14.1_sass@1.77.4_/node_modules/@unocss/vite/dist/index.mjs:125:12)
    at async configResolved (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/@unocss+vite@0.60.4_rollup@4.18.0_vite@5.2.12_@types+node@20.14.1_sass@1.77.4_/node_modules/@unocss/vite/dist/index.mjs:1031:7)
    at async Promise.all (index 6)
    at async resolveConfig (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/vite@5.2.12_@types+node@20.14.1_sass@1.77.4/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:69639:5)
    at async _createServer (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/vite@5.2.12_@types+node@20.14.1_sass@1.77.4/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:65857:20)
    at async CAC.<anonymous> (file:///Users/lizihang/open-source/github/nova-admin/node_modules/.pnpm/vite@5.2.12_@types+node@20.14.1_sass@1.77.4/node_modules/vite/dist/node/cli.js:762:24)
 ELIFECYCLE  Command failed with exit code 1.

Expected

command pnpm dev runs as expected

Additional comments

node---v20.12.2 pnpm---9.1.1

Validations

chansee97 commented 6 months ago

https://github.com/unocss/unocss/issues/3868 uno的依赖导致的问题,我上传了我的lock文件,更新到本地项目中并使用pnpm重新安装依赖可以解决这个问题

Azir-11 commented 6 months ago

pnpm更新到9.x也可以解决

chansee97 commented 6 months ago

pnpm更新到9.x也可以解决

我下午就是9.0.5试的,一样有这个问题