Have you read the Contributing Guidelines on issues?
Prerequisites
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
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clearoryarn clearcommand.rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages.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:
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
Self-service