-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
yarn build error with "Docusaurus found broken links" after set baseUrl to "/docs/" #6294
Comments
Interesting, this is because we don't add baseUrl to links that already seem to have base URL: I guess that's a bad assumption then😄 |
Yes, that's a bad assumpting that I made to fix issues we had in the past, where site owners had to use This was leading to verbosity (or requiring to update all links when updating the baseurl...). This "security" can probably be removed now, but we need to ensure that it does not produce any weird side-effect. Note React-Router has a special attribute to handle that: https://v5.reactrouter.com/web/api/BrowserRouter/basename-string but it has not been used historically. As part of the v6 upgrade we should probably try to use it |
@slorber I'm tempted to close this as wontfix, because |
not sure to understand, but the idea for me is that we should allow users to change baseUrl without rewriting URLs if we can build our own site with baseUrl = |
The problem is, what is the user's intent when they write a link like |
Actually there is a
I don't think it's ambiguous, the user intent should always be to link to |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi, I am having the same exact issue. What would be the recommended way forward if we want to deploy the Docusaurus build to /docs/ ? |
@MaximeKoitsalu I guess it really depends on the amount of links that are currently reported, and if you want your site to remain "portable" to future baseurl changes (ie not needing to rewrite all the links) It could be as simple as replacing a single link on your landing page.
For md files, using relative md file paths is the recommended way. Does it also trigger the problem? In any case you should be able to prepend the Why do you want
Please show a repro or a broken link checker error message to understand better the problem. |
Hi, any suggestions/improvements with this issue? I have the same error with the op as shown below when baseUrl: '/docs/' at gh-pages build pipe at 'yarn build' stage. Thank you in advance for any tips :)
|
@d8niz can't seem to reproduce on your repo here: Please provide a branch with code that fails to build otherwise it's impossible to help |
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I solved it by using a different Then the conflict didn't arise, and relative file pathing worked just fine. |
Same issue here. Quite weird that the naming of the repo affects the end result. Also renamed it to |
If your repo is called "docs" and it contains nothing else than docs (i.e. no landing page, no blog, etc.), you should set |
baseUrl (not docs) + routeBasePath
|
Can you help us understand what's your use-case? Why do you want cc @maxwowpow @ctrlaltdylan @drinkius @d8niz @MaximeKoitsalu |
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
yarn build error with "Docusaurus found broken links" after set baseUrl to "/docs/"
Steps to reproduce
Expected behavior
the links in files generated by build should be like this
Actual behavior
link in document should be like '/docs/docs/intro', but actually is '/docs/intro'
Your environment
Reproducible demo
No response
Self-service
The text was updated successfully, but these errors were encountered: