-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
documentationThe issue is related to the documentation of DocusaurusThe issue is related to the documentation of Docusaurus
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
I'm trying to diagnose a duplicated route warning, and I'm not sure what the problem is, I suspect it's a bug.
Reproducible demo
https://codesandbox.io/p/devbox/pensive-neumann-8hhhvs
Steps to reproduce
-
Create a file structure with similar file names, but in different folders. So different ids.
-
Add them in a TOC with the autogenerated instruction:
{
type: "category",
label: "service",
link: {
id: "tools/cli/service", // This is like the one below but that's a file.
type: "doc",
},
items: [
{
type: "autogenerated",
dirName: "tools/cli/service", // That's a directory, not a file.
},
],
},
- Build and get a duplicated route warning:
[WARNING] Duplicate routes found!
- Attempting to create page at /docs/tools/cli/service, but a page already exists at this route.
This could lead to non-deterministic routing behavior.
In my case, there is only 1 file, or page, living there (see repro) but I do have a folder with the same path.
Expected behavior
I shouldn't see a warning, since there is no file path duplication. Only one page will be rendered at that location.
Actual behavior
I get a duplicated route warning.
Your environment
- Docusaurus version used: 3.1
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationThe issue is related to the documentation of DocusaurusThe issue is related to the documentation of Docusaurus
