Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Instance Routes Not Working in v3.2.1 #10052

Closed
6 of 7 tasks
ojbravo opened this issue Apr 17, 2024 · 3 comments · Fixed by #10054
Closed
6 of 7 tasks

Multi-Instance Routes Not Working in v3.2.1 #10052

ojbravo opened this issue Apr 17, 2024 · 3 comments · Fixed by #10054
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@ojbravo
Copy link

ojbravo commented Apr 17, 2024

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

Running multi-instance in <= v3.1.1 works flawlessly. Upgrading to >= v3.2.0 breaks the non-default instance and displays a "Page Not Found". This occurs when the default instance has a routeBasePath: '/'.

Reproducible demo

https://stackblitz.com/edit/github-cwn3ck?file=package.json

Steps to reproduce

  1. Go to https://stackblitz.com/edit/github-cwn3ck?file=package.json
  2. Notice that @docusaurus/core, @docusaurus/preset-classic, @docusaurus/module-type-aliases, @docusaurus/types are all at v3.1.1 in the package.json
  3. Using the main navigation on the website, click on the Default Instance and Second Instance links. Both pages should appear as expected.
  4. In the package.json file, update @docusaurus/core, @docusaurus/preset-classic, @docusaurus/module-type-aliases, @docusaurus/types to v3.2.1
  5. Run the following commands in the terminal:
  • Ctrl+C
  • yarn clear
  • yarn
  • yarn start
  1. Using the main navigation on the website, click on the Default Instance and Second Instance links. The Default Instance should appear as expected, but the Second Instance will display a Page Not Found.

Expected behavior

Both instances should work in v3.2.1

Actual behavior

The Default Instance appears as expected, but the Second Instance will display a Page Not Found.

Your environment

Self-service

  • I'd be willing to fix this bug myself.
@ojbravo ojbravo added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 17, 2024
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Apr 18, 2024
@slorber
Copy link
Collaborator

slorber commented Apr 18, 2024

Thanks for the report, agree something weird is going on here.

Surprisingly, if I use baseUrl: "/" instead of /test/ then multi-instance works again.

I recently refactored the code to optimize the DX, and it's possible there's something wrong with how we order the routes in .docusaurus/routes.js (the order probably has changed? need to investigate locally because I can't see it in Stackblitz)

@slorber
Copy link
Collaborator

slorber commented Apr 18, 2024

Thanks for reporting, it should be fixed now

You can use the latest canary until we release: https://docusaurus.io/community/canary

(it should be safe, no breaking change, really it's 3.2.1 with just a few extra retrocompatible commits)

@johnrengelman
Copy link

Confirming that this fixed this issue in my project. Looking forward to 3.2.2 to avoid issues with peerDependencies in 3rd party plugins (always end up having to manually edit lockfiles to make canaries work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants