vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.16k stars 922 forks source link

[Bug report] Cant build project #1570

Closed Daiyangcheng closed 1 month ago

Daiyangcheng commented 1 month ago

Description

When I run npm run docs:build, appear below error info:

root@ser423788766121:~/code/vuepress-starter# npm run docs:build

> docs@1.0.0 docs:build
> vuepress build docs

✔ Initializing and preparing data - done in 106ms
⠹ Compiling with vite
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✔ Compiling with vite - done in 19.23s
✖ Rendering 10 pages - failed in 75ms
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@internal/routes' imported from /root/code/vuepress-starter/node_modules/@vuepress/client/dist/chunk-ZQJPP2LC.js
    at packageResolve (node:internal/modules/esm/resolve:853:9)
    at moduleResolve (node:internal/modules/esm/resolve:910:20)
    at defaultResolve (node:internal/modules/esm/resolve:1130:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36)

Reproduction

http://58.49.146.73:64521/

Used Package Manager

npm

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (8) x64 Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz
    Memory: 6.68 GB / 7.75 GB
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.11.1 - /usr/bin/node
    Yarn: Not Found
    npm: 10.8.0 - /usr/bin/npm
    pnpm: Not Found
    bun: Not Found
  Utilities:
    Git: 2.39.2 - /usr/bin/git
  Browsers:
    Chrome: Not Found
  npmPackages:
    @vuepress/bundler-vite: ^2.0.0-rc.12 => 2.0.0-rc.12 (2.0.0-rc.11)
    @vuepress/bundler-webpack:  2.0.0-rc.12 (2.0.0-rc.11)
    @vuepress/cli:  2.0.0-rc.12 
    @vuepress/client:  2.0.0-rc.12 (2.0.0-rc.9, 2.0.0-rc.11)
    @vuepress/core:  2.0.0-rc.12 (2.0.0-rc.9, 2.0.0-rc.11)
    @vuepress/markdown:  2.0.0-rc.12 (2.0.0-rc.9, 2.0.0-rc.11)
    @vuepress/shared:  2.0.0-rc.12 (2.0.0-rc.9, 2.0.0-rc.11)
    @vuepress/utils:  2.0.0-rc.12 (2.0.0-rc.9, 2.0.0-rc.11)
    vue:  3.4.27 
    vue-router:  4.3.2 
    vuepress: ^2.0.0-rc.12 => 2.0.0-rc.12
Mister-Hope commented 1 month ago

很明显有多个版本的vuepress

Mister-Hope commented 1 month ago

@meteorlxy 我们也许需要更新vuepress info

原则上我们现在只需要关注vue,vuepress、bundler 和 @vuepress/helper 的版本,并且如果发现多个版本应该特别列出。

github-actions[bot] commented 1 month ago

Hello @Daiyangcheng. Please provide a minimal reproduction using a GitHub repository or v2.vuepress.vuejs.org/new. Issues marked with need reproduction will be closed if they have no activity within 7 days.

meteorlxy commented 1 month ago

@Mister-Hope 我看 ecosystem 下现在在用 workspace:~ ,建议 rc 阶段还是用 workspace:* 锁版本号

Daiyangcheng commented 1 month ago
{
  "name": "docs",
  "version": "1.0.0",
  "description": "LoCyan Doc",
  "scripts": {
    "docs:dev": "vuepress dev docs",
    "docs:build": "vuepress build docs",
    "docs:info": "vuepress info"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@vuepress/bundler-vite": "^2.0.0-rc.12",
    "@vuepress/plugin-docsearch": "^2.0.0-rc.30",
    "@vuepress/theme-default": "^2.0.0-rc.32",
    "vuepress": "^2.0.0-rc.12"
  },
  "dependencies": {
    "vuepress-plugin-remove-html-extension": "^1.9.0",
    "vuepress-theme-reco": "^2.0.0-rc.12",
    "vuepress-theme-sidebar": "^0.1.0"
  }
}

这是我的 package.json, 还需要其他部分吗

mrholek commented 1 month ago

@Daiyangcheng please try to remove plugins from config.js/ts. In my case, @vuepress/plugin-back-to-top cause the same error

Mister-Hope commented 1 month ago

vuepress-plugin-remove-html-extension

this definitely a v1 plugin

Daiyangcheng commented 1 month ago

vuepress-plugin-remove-html-extension

this definitely a v1 plugin

This didn't work when i delete it from config.js

meteorlxy commented 1 month ago

Please try to provide a production repository. Or, you can get started with v2 guide: https://vuepress.vuejs.org/guide/getting-started.html#project-setup