Skip to content

[Bug report] Can't access pages by typing the urls directly in browser address bar #265

@Benbinbin

Description

@Benbinbin

Bug report

I can't access the page through typing the url directly in browser address bar, but after building and hosting the dist file, I can access all pages

Description

I use Vuepress-next as a static site generator to build my blog, in my project I add extra homepage and some navigation pages refer to the documentation method, so I don't use the default theme navbar and homepage. Then I cannot access any markdown pages but just show the extra homepage and navigation pages in dev environment.

If I build the project it work fine, or change the bundler to webpack, I can access all pages in dev environment.

I think if I don't refer to the Markdown file in navbar or homepage, then I can't access it through typing the corresponding url directly in browser address bar. Should I set any parameter in Vite to get it work in dev environment?

Steps to reproduce

  • Reproduction link / repo: a mini DEMO

Screenshots

  • use Vite as bundler in dev:
    image

    Snipaste_2021-07-06_00-28-00

  • use Webpack as bundler in dev:
    image

    Snipaste_2021-07-06_00-27-07

Environment info

  • Browser: Chrome
  • System: Win10
  • vuepress: 2.0.0-beta.21
  • vuepress-vite: 2.0.0-beta.21

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions