vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

`vitepress serve` tries to load an md.undefined.js file

Open valgeirb opened this issue 4 years ago • 4 comments

Describe the bug

First, thank you for your work on this package.

vitepress dev works fine, only when you build the docs and serve them with vitepress serve does this fail.

It tries to load a non-existing file:

app.0e8df899.js:90 GET http://localhost:5000/assets/guide_what-is-vue-popper.md.undefined.js net::ERR_ABORTED 404 (Not Found)

Reproduction

Here's my repo.

  1. Clone it
  2. npm i
  3. Change base in docs/.vitepress/config.js to base: "/"
  4. npm run build:docs
  5. npm run serve:docs
  6. See the error in the dev tools

Expected behavior

I don't understand why vitepress tries to serve this .undefined file.

System Info

System:
    OS: Linux 5.11 Zorin OS 16
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 4.16 GB / 31.23 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
    npm: 6.14.14 - ~/.nvm/versions/node/v14.17.5/bin/npm
  Browsers:
    Chrome: 94.0.4606.81
    Firefox: 93.0

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

valgeirb avatar Oct 10 '21 16:10 valgeirb

我也遇到同样的情况。

Greasen avatar Mar 09 '22 06:03 Greasen

Does this still happen?

kiaking avatar May 24 '22 01:05 kiaking

Hi, I can confirm that this issue still happening.

Screen Shot 2022-06-08 at 4 45 16 PM

I don't want to create another issue so I'll just comment here.

socheatsok78 avatar Jun 08 '22 09:06 socheatsok78

Replacing

https://github.com/vuejs/vitepress/blob/9004a801305fa0c21a0064253da95fbad38148fe/src/client/app/utils.ts#L38

by

https://github.com/vuejs/vitepress/blob/89cc718649b9be547c6ec08d2dc3d10a67f2a3ac/src/client/app/utils.ts#L38-L39

should fix this.

brc-dd avatar Jun 08 '22 09:06 brc-dd