facebook / facebook/docusaurus

`undefined` Value for Docs plugin `sidebarPath` Broken on Multi Version

Abierto
#7,968 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug status: needs more information
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#reporting-new-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

According to https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#sidebarPath if we set `undefined` as a value on `sidebarPath`, we can use fully autogenerated sidebar without using `sidebars.js` file.

On a fresh install, and set `sidebarPath` to `undefined` we can see that sidemenu autogenerated succesfully. However no sidemenu shown when enabling multiversioning.

### Reproducible demo

https://stackblitz.com/edit/github-bcjxsn

### Steps to reproduce

1. Create a new fresh instance of Docusaurus.
2. Open `docusaurus.config.js` set `sidebarPath` to undefined.
3. Delete `sidebars.js`. When you see the site, side menu will fully autogenerated.
4. Enable multiversioning, for example run `docusaurus docs:version 1.1.0` to add a version.
5. Delete `versioned_sidebars` folder, sidebar will not be autogenerated.

### Expected behavior

Setting `undefined` as a value of `sidebarPath` Docs plugin config should be enough to show fully autogenerated side menu without `sidebars.js` even when we enable multiversioning.

### Actual behavior

When multiversioning enabled, no side menu is autogenerated. User should add `versioned_sidebars` manually even if we set `undefined` as a value of `sidebarPath`.

### Your environment

- Docusaurus version used: 2.0.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version: MacOS Monterey 12.5

### Self-service

- [ ] 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.