vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.02k stars 2.1k forks source link

ReferenceError: Cannot access 'B' before initialization #4077

Open ytattn009 opened 3 months ago

ytattn009 commented 3 months ago

Describe the bug

项目打包部署后导航菜单不可用,控制台报错 framework.D6fyXT9h.js:13 Uncaught ReferenceError: Cannot access 'B' before initialization at Qr (framework.D6fyXT9h.js:13:5534) at theme.C-4cHeO8.js:1:460

Reproduction

项目打包部署后导航菜单不可用,控制台报错 framework.D6fyXT9h.js:13 Uncaught ReferenceError: Cannot access 'B' before initialization at Qr (framework.D6fyXT9h.js:13:5534) at theme.C-4cHeO8.js:1:460

Expected behavior

项目打包部署后导航菜单不可用,控制台报错 framework.D6fyXT9h.js:13 Uncaught ReferenceError: Cannot access 'B' before initialization at Qr (framework.D6fyXT9h.js:13:5534) at theme.C-4cHeO8.js:1:460

System Info

window11,
npm:8.19.4,
{
 "markdown-it-mathjax3": "^4.3.2",
 "markdown-to-text": "^0.1.1",
 "vitepress": "^1.3.1",
 "vitepress-markdown-timeline": "^1.2.1"
}
MS Edge

Additional context

No response

Validations

brc-dd commented 3 months ago

Please provide a minimal reproducible example using https://vitepress.new or a github repository. There is a likely a circular reference.

ytattn009 commented 3 months ago

Please provide a minimal reproducible example using https://vitepress.new or a github repository. There is a likely a circular reference.

you can start a new project

  1. npm i vitepress

  2. npm vitepress init

  3. open config.mts, add nav items. nav: [ { text: 'Home', link: '/' }, { text: 'Examples', items: [ { text: 'Examples`', link: '/' }] } ],

  4. npm run docs:build

  5. npm run docs:preview

  6. npm i vitepress

  7. npm vitepress init

  8. open config.mts, add nav items. nav: [ { text: 'Home', link: '/' }, { text: 'Examples', items: [ { text: 'Examples`', link: '/' }] } ],

  9. npm run docs:build

  10. npm run docs:preview

ytattn009 commented 3 months ago
2024-07-26 152104
brc-dd commented 3 months ago

There isn't any such error with the steps you mentioned. Please create a repo with that content and share a link here.