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

build: fail on broken anchors #2936

Merged
merged 1 commit into from
Sep 10, 2024
Merged

build: fail on broken anchors #2936

merged 1 commit into from
Sep 10, 2024

Conversation

alexplischke
Copy link
Collaborator

Description

Now that all broken anchors have been fixed, let's enable Docusaurus' broken anchor gating mechanism, which will fail the build if it detects any:

[ERROR] Error: Unable to build website for locale en.
    at tryToBuildLocale (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:54:19)
    at async /Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:65:9
    at async mapAsyncSequential (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
    at async Command.build (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:63:5) {
  [cause]: Error: Docusaurus found broken anchors!

  Please check the pages of your site in the list below, and make sure you don't reference any anchor that does not exist.
  Note: it's possible to ignore broken anchors with the 'onBrokenAnchors' Docusaurus configuration, and let the build pass.

  Exhaustive list of all broken anchors found:
  - Broken anchor on source page path = /mobile-apps/automated-testing/:
     -> linking to /dev/test-configuration-options/#bla

      at throwError (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/logger/lib/index.js:79:11)
      at reportBrokenLinks (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/server/brokenLinks.js:254:49)
      at handleBrokenLinks (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/server/brokenLinks.js:282:5)
      at executeBrokenLinksCheck (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:199:47)
      at /Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:145:66
      at Object.async (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/utils.js:36:47)
      at buildLocale (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:145:30)
      at async tryToBuildLocale (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:47:13)
      at async /Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:65:9
      at async mapAsyncSequential (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/utils/lib/jsUtils.js:21:24)
      at async Command.build (/Users/alexplischke/devel/sauce-docs/node_modules/@docusaurus/core/lib/commands/build.js:63:5)

@alexplischke alexplischke requested a review from a team September 10, 2024 17:01
Copy link

Deploy preview ready for 2936!
https://docs.dev.saucelabs.net/pr-preview/pr-2936

@alexplischke alexplischke merged commit 8a51f84 into main Sep 10, 2024
4 checks passed
@alexplischke alexplischke deleted the DEVX-3037/anchor-gating branch September 10, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants