Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

pnpm dev 报错 #159

Open
lulifa opened this issue Aug 8, 2024 · 4 comments
Open

pnpm dev 报错 #159

lulifa opened this issue Aug 8, 2024 · 4 comments

Comments

@lulifa
Copy link

lulifa commented Aug 8, 2024

PS D:\Project\docs\vue-vben-admin-doc> pnpm dev

[email protected] dev D:\Project\docs\vue-vben-admin-doc
vitepress dev

vitepress v0.14.1
vite v2.9.18
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.

@ldeng76
Copy link

ldeng76 commented Aug 16, 2024

同问

@forose
Copy link

forose commented Sep 6, 2024

同问啊

@aixiaodoucn
Copy link

我安装了几个依赖,执行build成功,执行serve可以预览了,但是dev还是报错。

"devDependencies": {
  "prettier": "^2.8.8",
  "vite-plugin-components": "^0.10.4",
  "vite-plugin-icons": "^0.6.5",
  "vite-plugin-windicss": "^1.9.3",
  "vitepress": "^0.14.1",
  "windicss": "^3.5.6"
},
"dependencies": {
  "@docsearch/css": "^3.6.2",
  "@docsearch/js": "^3.6.2",
  "@docsearch/react": "^3.6.2",
  "@iconify/json": "^1.1.461",
  "@vueuse/core": "^5.3.0",
  "vue": "^3.5.10"
}

改代码:.vitepress/theme-default/components/NavBar.vue
defineEmit 改成 defineEmits

@aixiaodoucn
Copy link

以下方式处理可正常运行 pnpm dev:
vite.config.js添加build配置项,指定入口文件。

const config: UserConfig = {
  build: {
    rollupOptions: {
      input: '.vitepress/config.js'
    }
  },
  ......
};

package.json依赖包如下

  "devDependencies": {
    "prettier": "^2.8.8",
    "vite-plugin-components": "^0.10.4",
    "vite-plugin-icons": "^0.6.5",
    "vite-plugin-windicss": "^1.9.3",
    "vitepress": "^0.14.1",
    "windicss": "^3.5.6"
  },
  "dependencies": {
    "@docsearch/css": "^3.6.2",
    "@docsearch/js": "^3.6.2",
    "@docsearch/react": "^3.6.2",
    "@iconify/json": "^1.1.461",
    "@vueuse/core": "^5.3.0",
    "@vueuse/shared": "^11.1.0",
    "vue": "^3.5.10",
    "vue-demi": "^0.14.10"
  }

我的运行环境:node18.16,pnpm9.4,依赖包使用pnpm安装

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants