vitepress
vitepress copied to clipboard
`vitepress serve` tries to load an md.undefined.js file
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.
- Clone it
npm i- Change
baseindocs/.vitepress/config.jstobase: "/" npm run build:docsnpm run serve:docs- 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.
我也遇到同样的情况。
Does this still happen?
Hi, I can confirm that this issue still happening.

I don't want to create another issue so I'll just comment here.
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.