-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Relative markdown links contain file extensions #10152
Comments
Yes, that is surprising. Have you only tried this in codesandbox? Can you try on your computer on a new Docusaurus repo instead? Because this is a very basic Docusaurus feature that should normally work otherwise we'd get thousands of bug reports. It seems to run fine locally, or inside StackBlitz: https://stackblitz.com/edit/github-mpurku?file=docs%2Fintro.md So I suspect this bug is only related to CodeSandbox. Maybe it's a new bug due to recent changes they made, and will self-resolve? 🤷♂️ |
Hi @slorber , I've tried it locally originally on a new docusaurus repo, and it didn't work for me. And then I tried in CodeSandbox when I was filling out this issue. |
@serpro69 can you provide a GitHub repo reproduction? I have one that shows it working as expected: ```md
Let's see how to [Create a page](./create-a-page.md).
```
**Result:** Let's see how to [Create a page](./create-a-page.md). https://tutorial.docusaurus.io/docs/tutorial-basics/markdown-features#links |
Yes, was just making it :) Here's the repo - https://github.com/serpro69/docusaurus-10152 For this example I ran Then started docusaurus with |
OK, a bit more debugging and it seems the problem is with |
It's not expected that the start command behave differently. Can you share a non-Codesandbox repro (ideally GitHub) where I can see the problem in action with the start command? |
Yes, already did above ;)
|
@serpro69 when running your GitHub repro, I can see that it works as expected, both start and build commands. https://pr.new/github.com/serpro69/docusaurus-10152 The UI works, the links are resolved correctly And there's no markdown link resolution error in the console: |
Hmm, I've just cloned my repo and it also works fine for me on a fresh clone. I then tried to re-initialize via I wonder if it's an issue that could be related to UPD: I tried to remove Anyways, it looks like this does in fact work as expected, so long as you clean up |
hmmm, weird, I don't know what's happening here 😅 Let's consider it works for now |
Problem identified. This is a legit problem that only happens in dev when you create one file and immediately link to it. Our mdx loader resolves links thanks to a I'll fix this as part of #10168 (edit: nop I'll open another PR to make things more explicit) |
facebook/docusaurus#10152 is the issue blocking Vercel so we must update for that to work correctly. Targets #1972 branch
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
I'm following the 5-minute tutorial and discovered that relative file paths are not converted to links (the file extension is not removed from the link, and hence results in 404)
Reproducible demo
https://codesandbox.io/p/sandbox/winter-pine-527qpc
Steps to reproduce
docs/foo.md
anddocs/bar.md
filesbar.md
fromfoo.md
:Expected behavior
bar page should open at
.../docs/bar
Actual behavior
the url contains file extension, i.e.
.../docs/bar.md
Your environment
Self-service
The text was updated successfully, but these errors were encountered: