-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
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
Docusaurus build fails when referencing root-domain images via relative paths, despite setting baseUrl and onBrokenMarkdownLinks: "warn".
settings:
baseUrl: https://test/websites/my-docusaurus-site
Desired image URL: https://test/images/qr.png
Markdown reference: 
Error:
Module build failed (from ../node_modules/@docusaurus/mdx-loader/lib/index.js):
Error: MDX compilation failed for file "docs\intro.md"
Cause: Image ../../images/qr.png used in docs/intro.md not found.
Details:
Error: Image ../../images/qr.png used in docs/intro.md not found.
at ensureImageFileExist (\node_modules\@docusaurus\mdx-loader\lib\remark\transformImage\index.js:84:15)
at async getImageAbsolutePath (\node_modules\@docusaurus\mdx-loader\lib\remark\transformImage\index.js:106:5)
at async processImageNode (\node_modules\@docusaurus\mdx-loader\lib\remark\transformImage\index.js:129:23)
at async Promise.all (index 1)
at async \docs\node_modules\@docusaurus\mdx-loader\lib\remark\transformImage\index.js:148:9
at compileToJSX (node_modules\@docusaurus\mdx-loader\lib\utils.js:93:15)
at async loadMDX (\node_modules\@docusaurus\mdx-loader\lib\loader.js:22:20)
at async Object.mdxLoader (\node_modules\@docusaurus\mdx-loader\lib\loader.js:156:24)
I try to use , however, it does not point to the website root, so I can only use ../../../images/qr.png to make sure its url is https://test/images/qr.png.
Any idea to solve this problem?
Reproducible demo
No response
Steps to reproduce
Simple docusaurus starter project can produce above issue
Expected behavior
Ignore validations in markdown file because I already set onBrokenMarkdownLinks to warning
Actual behavior
It still validate url in markdown for images
Your environment
- Public source code:
- Public site URL:
- Docusaurus version used:
- 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
featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.This is not a bug or issue with Docusausus, per se. It is a feature request for the future.