facebook / facebook/docusaurus

404 page not rendered when `routeBasePath` is `"/"`, and no version uses that path

Abierto
#9,688 13 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.