Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 29, 2025

Resolves the Docusaurus v3.9.1 deprecation warning by migrating the onBrokenMarkdownLinks configuration from the deprecated root-level location to the new markdown.hooks structure.

Problem

During builds with Docusaurus v3.9.1, the following deprecation warning was being emitted:

[WARNING] The `siteConfig.onBrokenMarkdownLinks` config option is deprecated and will be removed in Docusaurus v4.
Please migrate and move this option to `siteConfig.markdown.hooks.onBrokenMarkdownLinks` instead.

Solution

Migrated the configuration as recommended by the Docusaurus team:

Before:

const config = {
  // ... other config
  onBrokenMarkdownLinks: 'throw',
  markdown: {
    mermaid: true
  },
  // ...
}

After:

const config = {
  // ... other config
  markdown: {
    mermaid: true,
    hooks: {
      onBrokenMarkdownLinks: 'throw'
    }
  },
  // ...
}

Verification

  • ✅ Deprecation warning completely eliminated from build output
  • ✅ Build completes successfully (83.61s)
  • ✅ Broken markdown link detection functionality preserved and working
  • ✅ Site serves and functions normally

This change ensures forward compatibility with future Docusaurus versions while maintaining the same strict broken link detection behavior.

Original prompt

This section details on the original issue you should resolve

<issue_title>Update deprecated onBrokenMarkdownLinks config warning in Docusaurus v3.9.1 build</issue_title>
<issue_description>### Problem

During the build process with Docusaurus v3.9.1, the following warning is emitted:

Warning: The siteConfig.onBrokenMarkdownLinks config option is deprecated and will be removed in a future Docusaurus version.
Please migrate and move this option to siteConfig.markdown.hooks.onBrokenMarkdownLinks instead.

See the GitHub Actions log for details: https://github.com/axone-protocol/docs/actions/runs/18105930114/job/51520333696


Current Configuration

The deprecated option is set in docusaurus.config.js:

// https://github.com/axone-protocol/docs/blob/main/docusaurus.config.js
onBrokenMarkdownLinks: 'throw',

Proposed Solution

  • Migrate the onBrokenMarkdownLinks config from the root level to siteConfig.markdown.hooks.onBrokenMarkdownLinks as suggested by the warning message.
  • Test the build to confirm the warning is resolved.

References

Related code

docusaurus.config.js

// @ts-check
/** @type {import('@docusaurus/types').Config} */
const config = {
  ...
  onBrokenMarkdownLinks: 'throw',
  ...
  markdown: {
    mermaid: true
    // Move hooks config here as per Docusaurus config requirements
  },
  ...
};

</issue_description>

<agent_instructions>- Follow the conventional commit message format.

  • Limit the first line to 72 characters or less.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #737

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Sep 29, 2025 6:21pm

Co-authored-by: ccamel <9574336+ccamel@users.noreply.github.com>
Copilot AI changed the title [WIP] Update deprecated onBrokenMarkdownLinks config warning in Docusaurus v3.9.1 build fix: migrate onBrokenMarkdownLinks config to new location Sep 29, 2025
Copilot AI requested a review from ccamel September 29, 2025 18:20
Copy link
Member

@bot-anik bot-anik left a comment

Choose a reason for hiding this comment

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

Device URL
desktop http://localhost:3000/

Device URL
mobile http://localhost:3000/

Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead

Copy link
Member

@ccamel ccamel left a comment

Choose a reason for hiding this comment

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

Lgtm! Thx 😌

@ccamel ccamel marked this pull request as ready for review September 29, 2025 19:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@ccamel ccamel merged commit a0017c7 into main Sep 29, 2025
17 of 18 checks passed
@ccamel ccamel deleted the copilot/fix-0a876911-c898-4969-b61b-5bc5341121a3 branch September 29, 2025 19:46
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.

Update deprecated onBrokenMarkdownLinks config warning in Docusaurus v3.9.1 build

3 participants