question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Visiting `/docs` results `/docs.html` then 404 if `base` is set as `/docs/`

See original GitHub issue

Describe the bug

image image

Reproduction

https://github.com/JounQin/test/tree/vitepress

yarn docs:build --base /docs/ && yarn docs:serve --base /docs/

Expected behavior

http://localhost:8000/docs (Without ending slash) should work same as http://localhost:8000/docs/ (With ending slash)

System Info

System:
    OS: macOS 13.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 17.64 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/Library/Caches/fnm_multishells/3706_1656066380637/bin/node
    Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/3706_1656066380637/bin/yarn
    npm: 8.13.1 - ~/Library/Caches/fnm_multishells/3706_1656066380637/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Firefox: 101.0.1
    Safari: 16.0
  npmPackages:
    vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4

Additional context

No response

Validations

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
staghousecommented, Aug 3, 2022

Just to add some color here, VuePress handles this the way to OP is requesting. Leaving out the trailing slash resolves the url to directory index.html which does make sense to me - the path should resolve to a usable path which is the trailing slash.

This is probably more particularly important for nested documentation pages like /docs/something/index.md. When leaving out the trailing slash it resolves to /docs/something.html which would never be a built path in this case.

0reactions
ranqiangjuncommented, Dec 16, 2022

BTW, the extra .html appended to /docs as /docs.html on the screenshot happens with cleanUrls: "off"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exploring GitLab Pages
This problem most likely results from a missing index.html file in the public directory. If after deploying a Pages site a 404 is...
Read more >
404. That's an error. The requested URL was not found on this ...
As you might know, a 404 error is "File not found." This can happen when a file is deleted or there is an...
Read more >
Move a Website and Change URL | Google Search Central
Learn how to change the URLs of existing site pages, including domain name changes. Explore moving a website with little impact on search...
Read more >
Troubleshoot Cloud Run issues
The following error occurs when you try to deploy or try to call another Google Cloud API: The server has encountered an internal...
Read more >
HTTP response status codes - MDN Web Docs - Mozilla
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found