vuejs / vitepress

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

Not easy to debug error only in dev mode #1395

Closed emersonbottero closed 2 years ago

emersonbottero commented 2 years ago

Describe the bug

The build and serve commands works but the dev doesn't.

Reproduction

clone the repo

The error thrown is misleading in my opinion..

Uncaught TypeError: Cannot read properties of undefined (reading 'accept') at VPSkipLink.vue:37:3

Expected behavior

the error should point to the correct file? I'm sure is not a problem in VPSkipLink file. Is hard to debug without knowledge of vitepress internal logic

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    Memory: 8.47 GB / 15.92 GB
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.1.3 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Chrome: 105.0.5195.127
    Edge: Spartan (44.22621.601.0), Chromium (105.0.1343.50)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vitepress: ^1.0.0-alpha.15 => 1.0.0-alpha.15

Additional context

I'm convincing the mermaidjs team to update their documentation to use vitepress šŸ˜. I created a repo from scratch first and it works without problem but in the mermaid repo this error may be a combination of the setting done in packaeg.json and tsconfig but!

I think we really want anyone to be able to use vitepress to update any library out there (mission inspiration?? šŸ˜…)

Validations

brc-dd commented 2 years ago

Finally got a reproduction šŸ˜…. (This is same as #1374 BTW. )

brc-dd commented 2 years ago

Fixed in https://github.com/vitejs/vite/pull/10207

yaman3bd commented 2 years ago

@brc-dd I am still having the same error, my file structure: Screen Shot 2022-09-24 at 10 54 23 PM

config.ts is empty, index.md has just a demo message: # Hello world I think by default it should show whatever inside index.md file but after starting the server an empty page shows with the same error: Screen Shot 2022-09-24 at 10 57 12 PM my packages versions:

    "vite": "^3.1.2",
    "vitepress": "^1.0.0-alpha.16",
    "vue": "^3.2.39"

is there something missing, or wrong I am doing?

emersonbottero commented 2 years ago

@yaman3bd it has not been published yet.. wait for the next vite release!

emersonbottero commented 2 years ago

@brc-dd I'm still getting the same error. You can update vitepress and vite in the mentioned repo to see the problem.

brc-dd commented 2 years ago

I haven't released a new version yet.

brc-dd commented 2 years ago

Weird, not working on alpha-18 too :/

brc-dd commented 2 years ago

Ah, this will be fixed in next version of @vitejs/plugin-vue