-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Broken link detection in development #6998
Comments
I think it's possible, but there'll be false-positives since we can't know if a link is linking to a static asset (we detect that by making FS calls). Still it's mostly fine IMO |
Thanks @Josh-Cena 🤔 Good point about the static asset linking. False positives are less than ideal, maybe we might set it at We may want additional information in an error message to state something to that effect, and the user can run the build check to determine if it is a false positive or not. I don't know if that is just an extra inconvenience. Would you think we would we better applying this as a boolean with a new property such as |
Yes, that's exactly how I would design it: give some feedback, but also remind users about false-positives. @slorber Do you think this sounds reasonable? |
It seems like this was requested on the canny feature request board as well, my apologies for not checking! https://docusaurus.io/feature-requests/p/onbrokenlinks-in-development.
|
Hi @YOU54F , I've had the similar broken link issues. Instead of completely relying on Docusaurus to solve them, there are third-party tools designed for broken link checks. I tried all of them when I was maintaining a document website, and the third tool is more handy than the other two. https://validator.w3.org/checklink |
Awesome dude, checking these out, as especially external links may die over time and not necessarily at fault to the creator of a PR. Running an check via another tool, as a cron job with a report, and an issue raised in the respective repo to resolve, might be enough of a call to action to fix 👍🏾 |
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
Hello,
I am currently working through our https://docs.pact.io site and we had a number of broken links.
We have now set
onBrokenLinks
to true, which causes the build the fail. 👍🏾however as noted in the docs
I would love to give my contributors earlier feedback, during development as per to
onDuplicateRoutes
when they run
yarn start
.I haven't looked at the codebase, to see the rational for this only being applicable for production builds at the moment.
Thanks in advance and also for the great project!
Reproducible demo
No response
Steps to reproduce
onBrokenLinks
toerror
yarn start
and user is not notified there are broken linksyarn build
and build fails with user notified of broken linksExpected behavior
onBrokenLinks
toerror
yarn start
and build fails with user notified of broken linksyarn build
and build fails with user notified of broken linksActual behavior
onBrokenLinks
toerror
yarn start
and user is not notified there are broken linksYour environment
Self-service
The text was updated successfully, but these errors were encountered: