Getting broken link on existing document path
See original GitHub issueHave 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 clear
oryarn 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
Docusaurus is reporting a broken link for a path that exists if the Markdown file is in a directory of the same name as the Markdown file. (e.g. /docs/tutorial/tutorial.md
) See the reproducible demo.
Reproducible demo
https://github.com/dprothero/docusaurus-broken-links
Steps to reproduce
- Run
npx create-docusaurus@latest my-website classic
cd my-website
- Add a docs/tutorial-basics/quickstart/quickstart.md file with any contents.
- Adde a link to the new quickstart.md in the docs/intro.md file.
- Run
npm run build
This produces the following output:
[ERROR] Unable to build website for locale en.
[ERROR] Error: Docusaurus found broken links!
Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.
Exhaustive list of all broken links found:
- On source page path = /docs/intro:
-> linking to /docs/tutorial-basics/quickstart/quickstart.md
Expected behavior
It should not report a broken link. It should build successfully.
Actual behavior
[ERROR] Unable to build website for locale en.
[ERROR] Error: Docusaurus found broken links!
Please check the pages of your site in the list below, and make sure you don't reference any path that does not exist.
Note: it's possible to ignore broken links with the 'onBrokenLinks' Docusaurus configuration, and let the build pass.
Exhaustive list of all broken links found:
- On source page path = /docs/intro:
-> linking to /docs/tutorial-basics/quickstart/quickstart.md
Your environment
- Public source code: N/A (source code is private)
- Public site URL: N/A (site is private)
- Docusaurus version used: 2.0.0-beta.18
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Node.js v16.4.1, browser is N/A
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS Big Sur v11.6.4
Self-service
- I’d be willing to fix this bug myself.
Issue Analytics
- State:
- Created a year ago
- Comments:11
Top Results From Across the Web
Fix broken links to data - Microsoft Support
Browse to the location of the file containing the linked data. Select the new source file, and then click Change Source. Click Close....
Read more >What are Broken Links? And How Do You Find and Fix Them?
A broken link is a web-page that can't be found or accessed by a user, for various reasons. Web servers will often return...
Read more >How to Find and Fix Broken Links on Your Website
Go to Administration – Site building – URL redirects. Click “Add redirect”. Fill in the “From” and “To” blanks by copying and pasting...
Read more >How to find and fix broken links in Excel - Ablebits
When a source workbook gets deleted, relocated, or damaged, external references to that file break down and your formulas start returning errors ...
Read more >Preventing broken links in Microsoft Word documents - IBM
Procedure · Click the Microsoft Office icon, and then Prepare > Edit links to files. This menu entry is available only if your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s probably not your fault, nobody reads long changelogs anyway 😅
After 2.0 launch the goal is to do such changes on major versions and have a dedicated blog post with clearer instructions and breaking change highlights
OK, so this was my root problem:
The other, somewhat confusing methods of URL resolution led me to believe I had reproduced the issue in the repo.
Lessons learned:
So, this issue can be closed, unless you want to keep it open until the docs changes are released.