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

Cannot resolve links when folders have periods in the name #9621

Open
6 of 7 tasks
adunndevster2 opened this issue Dec 8, 2023 · 1 comment
Open
6 of 7 tasks

Cannot resolve links when folders have periods in the name #9621

adunndevster2 opened this issue Dec 8, 2023 · 1 comment
Labels
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

Comments

@adunndevster2
Copy link

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

I'm trying to link to docs in my docset that have periods "." in the folder name. * 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.
@adunndevster2 adunndevster2 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 Dec 8, 2023
@patridge
Copy link

It appears that this only affects links when the final URL segment contains a period. So, while /something/something.something would faile, /something/something.something/another would work fine. It also still fails for all the variants on that URL that resolve to the same page.

  • /something/something.something -> fail
  • /something/something.something/ -> fail
  • /something/something.something/index -> fail
  • /something/something.something/index.md -> fail

I've also tried a backslash without any luck.

  • /something/something\.something/ -> fail

Workaround

It's not a great solution, but it appears you can work around this issue by encoding the final segment's URL using percent encoding, which isn't strictly necessary for URL encoding. By swapping the . to %2E, it seems that the routing system is appeased.

  • /something/something%2Esomething/ (or /Meadow%2EFoundation for the original example).

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 status: needs triage This issue has not been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants