facebook / facebook/docusaurus
404 page not rendered when `routeBasePath` is `"/"`, and no version uses that path
- Dominant language
- TypeScript
- Stars
- 66.2k
- Forks
- 10k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 52
Description
### Have you read the Contributing Guidelines on issues?
- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).
### Prerequisites
- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the `npm run clear` or `yarn clear` command.
- [X] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).
### Description
Combining `routeBasePath: '/',` with having each version at a specific path (the version itself) results in unknown pages rendering "blank" content (instead of the "Page not found" content).
### Reproducible demo
https://stackblitz.com/edit/github-py3g6d?file=docusaurus.config.js
### Steps to reproduce
From a fresh project:
```console
$ npm run docusaurus docs:version 1.1.0
```
And add the following to the `docs` config:
```js
routeBasePath: '/',
versions: {
current: { path: '/current' },
'1.1.0': { path: '/1.1.0' },
},
```
then visit `/foo` route. No "Page Not Found" content :cry:
### Expected behavior
Render the "Page not found" content
### Actual behavior
Empty page
### Your environment
_No response_
### Self-service
- [x] I'd be willing to fix this bug myself.
Contributor guide
Assessment
This issue has not been assessed yet.