Skip to content

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

Open
@thejcannon

Description

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • 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:

$ npm run docusaurus docs:version 1.1.0

And add the following to the docs config:

          routeBasePath: '/',
          versions: {
            current: { path: '/current' },
            '1.1.0': { path: '/1.1.0' },
          },

then visit /foo route. No "Page Not Found" content 😢

Expected behavior

Render the "Page not found" content

Actual behavior

Empty page

Your environment

No response

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions