vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Even after adding a custom 404.md, the standard 404 page is displayed.

Open kawamataryo opened this issue 9 months ago • 1 comments

Describe the bug

I am creating documentation using VitePress. To display a custom 404 page, I added a 404.md file. However, after building the project, the standard 404 page is displayed instead.

Here is the reproduction environment: https://stackblitz.com/edit/vite-pukdjm?file=docs%2F404.md

Accessing /404.html displays the custom 404 page. However, when accessing non-existent paths such as /foo.html, the standard 404 page appears instead (the custom 404 page is briefly displayed, but then seems to get replaced). How can I ensure that the custom 404 page is displayed when accessing non-existent paths?

Reproduction

https://stackblitz.com/edit/vite-pukdjm?file=docs%2F404.md

Expected behavior

custom 404.md page is displayed.

System Info

System:
    OS: macOS 14.4
    CPU: (8) arm64 Apple M2
    Memory: 93.02 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - ~/.asdf/installs/nodejs/18.18.2/bin/node
    Yarn: 1.22.19 - ~/.asdf/installs/nodejs/18.18.2/bin/yarn
    npm: 10.2.5 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 8.12.0 - ~/.asdf/installs/nodejs/18.18.2/bin/pnpm
    bun: 1.0.29 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 124.0.6367.201
    Edge: 124.0.2478.97
    Safari: 17.4

Additional context

No response

Validations

kawamataryo avatar May 11 '24 06:05 kawamataryo

ref https://github.com/vuejs/vitepress/discussions/3880

kawamataryo avatar May 11 '24 07:05 kawamataryo