Skip to content
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

Using partial props in links causes false positive onBrokenLinks #9989

Closed
3 of 7 tasks
anatolykopyl opened this issue Mar 27, 2024 · 2 comments
Closed
3 of 7 tasks

Using partial props in links causes false positive onBrokenLinks #9989

anatolykopyl opened this issue Mar 27, 2024 · 2 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.

Comments

@anatolykopyl
Copy link
Contributor

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn 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

If a link inside of a partial uses some value from props, then the link checking marks it as broken.

Reproducible demo

No response

Steps to reproduce

  1. Create a partial
  2. Create a link that looks like this in the partial:
<a href={`/examples/${props.examplePath}`}>example</a>

Expected behavior

There is no error during build

Actual behavior

An error occurs during build.

Your environment

No response

Self-service

  • I'd be willing to fix this bug myself.
@anatolykopyl anatolykopyl added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Mar 27, 2024
@Josh-Cena
Copy link
Collaborator

What happens if you change this to:

import Link from "@docusaurus/Link";

<Link to={`/examples/${props.examplePath}`}>example</Link>

@slorber
Copy link
Collaborator

slorber commented Mar 28, 2024

Proof that it works, this builds fine: https://stackblitz.com/edit/github-oz38cy?file=docs%2F_partial.mdx,docs%2Fintro.md

<a> are just regular links that are not even checked by the broken link checker


Please always provide a repro next time. Otherwise you put the burden on me to prove that the bug doesn't exist.

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
@slorber slorber added closed: can't repro This bug is because of some local setup that can't be reproduced. and removed status: needs triage This issue has not been triaged by maintainers labels Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution closed: can't repro This bug is because of some local setup that can't be reproduced.
Projects
None yet
Development

No branches or pull requests

4 participants
@slorber @anatolykopyl @Josh-Cena and others