Skip to content

Docs: Fix the broken asyncRequireModulePath anchor - #2190

Merged
robhogan merged 2 commits into
react:mainfrom
vzaidman:vzaidman/fix-asyncrequiremodulepath-anchor
Nov 6, 2026
Merged

robhogan merged 2 commits into
react:mainfrom
vzaidman:vzaidman/fix-asyncrequiremodulepath-anchor

Conversation

@vzaidman

@vzaidman vzaidman commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Summary

#2180 links to #asyncrequiremodulepath in docs/Configuration.md, backed by <a name="asyncrequiremodulepath"></a>. Docusaurus doesn't count raw HTML anchors in its broken anchor check, so the website build fails, and the website deploy on main has failed since #2180.

The heading sets its id explicitly instead, {#asyncrequiremodulepath}, which is also its id before the "Deprecated" label was added, so old links keep working.

Changelog: [Internal]

Test plan

  • yarn build in website/ (Node 22) fails on main with "Broken anchor on source page path = /docs/configuration: linking to #asyncrequiremodulepath", and succeeds with this change. The built page has id="asyncrequiremodulepath" on the heading.
  • prettier --check and markdownlint-cli2 pass on docs/Configuration.md.

Sets the `asyncRequireModulePath` heading id explicitly, so Docusaurus finds the `#asyncrequiremodulepath` anchor, which raw `<a name>` tags do not provide.

Changelog: [Internal]
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 6, 2026
@vzaidman
vzaidman requested review from huntie and robhogan November 6, 2026 13:13
@robhogan

robhogan commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks, but doesn't this break #asyncrequiremodulepath-deprecated, which worked before (and has been the canonical anchor for several years)?

I think the issue here is really that the link in #2180 was wrong (it should've pointed to #asyncrequiremodulepath-deprecated), not that the anchor is wrong.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Metro review: Looks good

Risk: low · Commit: e8a7128 · 3 commands run

The PR swaps the raw <a name="asyncrequiremodulepath"> anchor for an explicit Docusaurus heading id, {#asyncrequiremodulepath}. That fixes the broken-anchor error that has been failing the website build. I reproduced the failure on the base build and a clean pass on the head build. The heading renders with id="asyncrequiremodulepath", so the in-page link and old external links still resolve.

No findings.

Verified
  • ✅ yarn --cwd website install --frozen-lockfile && yarn --cwd website build (base scratch copy, via package_manager) (failed as expected) — Fails with 'Broken anchor ... linking to #asyncrequiremodulepath'. Both scratch builds had env-only tweaks: the internaldocs plugin was patched to tolerate a missing hg, and showLastUpdateTime was turned off (no git repo).
  • ✅ yarn --cwd website build (head scratch copy, via package_manager, same env tweaks) — Succeeds with onBrokenAnchors: 'throw'. In the built configuration page the h4 has id="asyncrequiremodulepath" and keeps its Deprecated label; the resolveRequest link targets it.
  • ✅ node_modules/.bin/prettier --check docs/Configuration.md

Not run: markdownlint-cli2 was not run. The website builds ran in scratch copies with two environment-only tweaks: no hg binary, and last-update time turned off because the copies aren't git repos. The change is docs-only, so there are no code tests, benchmarks or Windows checks to run.

Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call.

@robhogan robhogan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amended to just fix the link rather than change the anchor

@robhogan
robhogan merged commit 89476f4 into react:main Nov 6, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants