facebook / facebook/docusaurus

Cannot resolve links when folders have periods in the name

Open
#9,621 1 comment 1 reaction 0 assignees View on GitHub
bug status: needs triage
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#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

I'm trying to link to docs in my docset that have periods "." in the folder name. * [Meadow.Foundation](/Meadow/Meadow.Foundation/) for example.

This doesn't work though and give me the error Module not found: Error: Can't resolve './../../Meadow.Foundation' in '/Users/adam/_/Documentation/docs/Meadow/Getting_Started/Getting_Started_Core-Compute_Module'

I've confirmed it's due to the period in the folder name. Is there a way we can keep periods in our folder names and get this to work?

### Reproducible demo

https://github.com/WildernessLabs/Documentation/tree/docusaurus

### Steps to reproduce

1. Have a folder that has a period in its name
2. Create a link to a document within that folder
3. `npm start`
4. You should see that it can't resolve that link

### Expected behavior

Please resolve links to documents within folders that have periods in their names 🙏🏻

### Actual behavior

Module not found: Error: Can't resolve './../../Meadow.Foundation' in '/Users/adam/_/Documentation/docs/Meadow/Getting_Started/Getting_Started_Core-Compute_Module'
Module not found: Error: Can't resolve './../../Meadow.Foundation' in '/Users/adam/_/Documentation/docs/Meadow/Getting_Started/Hello_World'
Module not found: Error: Can't resolve './Maple.Server' in '/Users/adam/_/Documentation/docs/Meadow/Meadow.Foundation/Libraries_and_Frameworks'
Module not found: Error: Can't resolve './../../Meadow.Foundation/Libraries_and_Frameworks/Maple.Server' in '/Users/adam/_/Documentation/docs/Meadow/Meadow.OS/Networking'
Module not found: Error: Can't resolve './../../Meadow.Foundation' in '/Users/adam/_/Documentation/docs/Meadow/Meadow_Basics/IO'
Module not found: Error: Can't resolve './../../Meadow.OS' in '/Users/adam/_/Documentation/docs/Meadow/Meadow_Basics/Meadow.OS'
Module not found: Error: Can't resolve './../Meadow.Foundation' in '/Users/adam/_/Documentation/docs/Meadow/Meadow_Basics'
Module not found: Error: Can't resolve './../../Meadow.Foundation/Libraries_and_Frameworks/Maple.Server' in '/Users/adam/_/Documentation/docs/Meadow/Meadow․Foundation/Libraries_and_Frameworks'
Module not found: Error: Can't resolve './../../Meadow.Foundation/Libraries_and_Frameworks/Maple.Server' in '/Users/adam/_/Documentation/docs/Meadow/Release_Notes/Beta4'
Module not found: Error: Can't resolve './Meadow.Foundation' in '/Users/adam/_/Documentation/docs/Meadow'
client (webpack 5.89.0) compiled with 10 errors

### Your environment

- Public source code:
- Public site URL:
- Docusaurus version used: 2, (pretty involved to upgrade to 3, but we plan on it)
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node 18.15.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Mac OS Ventura 13.2.1, Ubuntu on the build server

### 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.