facebook / facebook/docusaurus

Using docs routeBasePath="/", navbar version dropdown displays incorrect version on "/"

Open
#7,974 2 comments 0 reactions 0 assignees View on GitHub
bug
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#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

Hi,
When routeBasePath option is set to "/", going back to the home page either through the breadcrumb or the root url (company logo) resets the version to the 'current' one, whatever the version we were using.

### Reproducible demo

https://doc4d.github.io/docs/19/API/ClassClass

### Steps to reproduce

1. Go to the page above (v19)
2. Click on the company logo or the Home in the breadcrumb

### Expected behavior

The home page is displayed with "v19" in the version menu

### Actual behavior

The home page is displayed with "v19 R6" (which is the current one) in the version menu

### Your environment

- Public source code:
- Public site URL:
- Docusaurus version used:
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):

### Self-service

- [ ] I'd be willing to fix this bug myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.