[docs] Fix broken links checker crashing on 404 known-targets fetch#22707
Conversation
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.
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
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.
There was a problem hiding this comment.
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
ignoredPathsregex that skips links to other MUI products and main-site sections. - Removes the
knownTargetsDownloadUrlconfiguration 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.
|
Oh right, that's what moving the links check to CI did. cc @dav-is |
Janpot
left a comment
There was a problem hiding this comment.
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 |
|
ok mui/material-ui#48634 proposes to revert |
…ui#22707) Co-authored-by: Claude <[email protected]>
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