Skip to content

[docs] Fix broken links checker crashing on 404 known-targets fetch#22707

Merged
Janpot merged 4 commits into
mui:masterfrom
sai6855:claude/broken-links-checker-404-fgY3E
Jun 8, 2026
Merged

[docs] Fix broken links checker crashing on 404 known-targets fetch#22707
Janpot merged 4 commits into
mui:masterfrom
sai6855:claude/broken-links-checker-404-fgY3E

Conversation

@sai6855

@sai6855 sai6855 commented Jun 8, 2026

Copy link
Copy Markdown
Member

The link checker downloaded known link targets from https://mui.com/material-ui/link-structure.json, which currently returns a 404. The crawler's fetch helper throws on any non-OK response, so the whole docs build failed.

Drop the knownTargetsDownloadUrl option and instead ignore cross-product link paths (the approach used by the material-ui docs script) so links to other MUI products are not flagged as broken.

Opened this pr due to deployment issues in recently opened PR's, #22704

The link checker downloaded known link targets from
https://mui.com/material-ui/link-structure.json, which currently returns
a 404. The crawler's fetch helper throws on any non-OK response, so the
whole docs build failed.

Drop the knownTargetsDownloadUrl option and instead ignore cross-product
link paths (the approach used by the material-ui docs script) so links to
other MUI products are not flagged as broken.
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-22707--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@sai6855 sai6855 added type: bug It doesn't behave as expected. docs Improvements or additions to the documentation. labels Jun 8, 2026
sai6855 and others added 3 commits June 8, 2026 17:46
With the crawler now running end-to-end, it flagged 692 broken links.
All of them are the same class of false positive: links to main mui.com
pages not served by the isolated /x docs export — overwhelmingly the
site-wide v9 announcement banner pointing to /blog/introducing-mui-v9/,
plus a couple of /pricing and /blog/* links. These resolve on the live
site but 404 in this preview build.

Add /blog, /pricing, /about and /careers to ignoredPaths so cross-site
links are not reported as broken.
@sai6855
sai6855 marked this pull request as ready for review June 8, 2026 13:35
Copilot AI review requested due to automatic review settings June 8, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the docs broken-links checker script to avoid failing the docs build when the “known targets” JSON endpoint returns a 404, by removing the remote known-targets fetch and instead ignoring cross-product/main-site paths that aren’t present in the /x preview export.

Changes:

  • Replaces the previous “known targets download” approach with an ignoredPaths regex that skips links to other MUI products and main-site sections.
  • Removes the knownTargetsDownloadUrl configuration that caused the crawl to fail when the endpoint returned non-OK responses.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sai6855
sai6855 requested review from Janpot and alexfauquette June 8, 2026 13:43
@Janpot

Janpot commented Jun 8, 2026

Copy link
Copy Markdown
Member

Oh right, that's what moving the links check to CI did. cc @dav-is

@Janpot Janpot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, let's disable until we decide what to do with the known links

@sai6855

sai6855 commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Ok, let's disable until we decide what to do with the known links

Can you merge PR, I'm not able to do it

@Janpot

Janpot commented Jun 8, 2026

Copy link
Copy Markdown
Member

ok mui/material-ui#48634 proposes to revert

@Janpot
Janpot merged commit 413df8e into mui:master Jun 8, 2026
21 checks passed
mbrookes pushed a commit to mbrookes/mui-x that referenced this pull request Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants