Have you read the Contributing Guidelines on issues?
Prerequisites
Description
Hello,
I have ran into the following issue when generating documentation for some projects:
If one of the md files contains a link to a local directory that has a dot . in its name AND that directory exists, then the docusaurus default mdx plugins will try to parse it using require(), and break the build with the following message:
Module not found: Error: Can't resolve './../directory-with.dot' in '/home/projects/pariqjjolg.github/docs'
Link to repro URL: https://stackblitz.com/edit/github-c3qe69at?file=docs%2Fintro.mdx
Offending line:
[This link breaks the build](../directory-with.dot/)
Probable Cause
The code at transformLinks seems to try to parse the file path and if it has a md-like extension, it calls toAssetRequireNode().
There should probably be added a directory check somewhere here. I am no javascript expert but I can attempt to create a MR if it helps.
Reproducible demo
https://stackblitz.com/edit/github-c3qe69at?file=docs%2Fintro.mdx
Steps to reproduce
- From the provided demo just run
yarn build.
Or alternatively from a clean repo:
- Add this to a parsed md file:
[This link breaks the build](../directory-with.dot/)
- Create the directory and put a dummy md file in it.
- Run
yarn build
Expected behavior
The build should pass and link to directory created.
Actual behavior
The following error is produced:
Module not found: Error: Can't resolve './../directory-with.dot' in '/home/projects/pariqjjolg.github/docs'
Your environment
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
Hello,
I have ran into the following issue when generating documentation for some projects:
If one of the md files contains a link to a local directory that has a dot
.in its name AND that directory exists, then the docusaurus default mdx plugins will try to parse it usingrequire(), and break the build with the following message:Link to repro URL: https://stackblitz.com/edit/github-c3qe69at?file=docs%2Fintro.mdx
Offending line:
Probable Cause
The code at transformLinks seems to try to parse the file path and if it has a md-like extension, it calls
toAssetRequireNode().There should probably be added a directory check somewhere here. I am no javascript expert but I can attempt to create a MR if it helps.
Reproducible demo
https://stackblitz.com/edit/github-c3qe69at?file=docs%2Fintro.mdx
Steps to reproduce
yarn build.Or alternatively from a clean repo:
[This link breaks the build](../directory-with.dot/)yarn buildExpected behavior
The build should pass and link to directory created.
Actual behavior
The following error is produced:
Your environment
Self-service