Skip to content

[AAASM-3785] 🐛 (docs): Fix docs URL TypeError and releases/latest 404#187

Merged
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-3785/fix_docs_version_url_error
Jun 26, 2026
Merged

[AAASM-3785] 🐛 (docs): Fix docs URL TypeError and releases/latest 404#187
Chisanan232 merged 1 commit into
masterfrom
v0.0.1/AAASM-3785/fix_docs_version_url_error

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

Description

Two errors fire on load of the built mkdocs-material docs:

  1. Uncaught TypeError: Failed to construct 'URL': Invalid URL — Material's
    partials/javascripts/outdated.html emits new URL("{{ base_url }}") with no
    base argument; on most pages base_url is a bare relative value (. / ..),
    which is not an absolute URL.
  2. GET https://api.github.com/repos/ai-agent-assembly/python-sdk/releases/latest → 404
    Material's bundled JS fetches GitHub "source facts" (stars, forks, latest
    release tag) for the data-md-component="source" element. This repo publishes
    no GitHub Releases, so the latest-release lookup 404s on every page load.

Fix

  • (2) Add docs/_overrides/partials/source.html that drops the
    data-md-component="source" marker. The repository link, icon and name are
    preserved, but Material no longer issues any unauthenticated GitHub API call —
    eliminating the 404 (and the anonymous rate-limit exposure).
  • (1) Already fixed on master by the existing
    docs/_overrides/partials/javascripts/outdated.html override (it passes
    location as the base: new URL("{{ base_url }}", location)). The live site
    still throws only because its deployment predates that override; rebuilding /
    redeploying from this PR clears it. No new code was needed for (1).

Type of Change

  • 🔧 Bug fix
  • 📚 Documentation update

Breaking Changes

  • No

Related Issues

  • Related JIRA ticket: AAASM-3785
  • Closes AAASM-3785

Testing

  • Manual testing performed
  • No tests required (explain why — docs theme override; verified via browser)

Self-verification (headless Chromium via Playwright, against mkdocs build
output served locally with a mike-style versions.json to exercise the full
deployed code path):

Build new URL TypeError releases/latest 404
Live deployed site (before) present present
Rebuilt with this fix — index page none none
Rebuilt with this fix — deep page (/configuration/) none none

The only remaining network entry is the Google Analytics collect request
being aborted, which is the expected privacy behavior (analytics gated behind
unaccepted cookie consent), not an error.

Screenshot of the rebuilt index page (zero console/page errors), attached in a
follow-up comment.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated if needed
  • All tests passing

🤖 Generated with Claude Code

Override Material's partials/source.html to drop the
`data-md-component="source"` marker. Material's bundled JS fetches GitHub
"source facts" (stars, forks, latest release) for that element; this repo
publishes no GitHub Releases, so the latest-release lookup
(GET api.github.com/repos/ai-agent-assembly/python-sdk/releases/latest)
404s on every page load as an uncaught console error. The override keeps
the repository link, icon and name but issues no unauthenticated GitHub
API call, removing the 404 and the anonymous rate-limit exposure.

Verified with a headless-Chromium load of the rebuilt site (index and a
deep page): zero page errors and zero console errors. The companion
new URL("{{ base_url }}") TypeError is already fixed on master by the
existing outdated.html override; this rebuild/redeploy clears it from the
stale live deployment too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019mSz31RysZF6DYToUoBWLf
@Chisanan232

Copy link
Copy Markdown
Contributor Author

🤖 Claude Code — PR Review (AAASM-3785)

Recommendation: ✅ Approve

Independent review of the mkdocs-material docs fix.

CI

All checks green, incl. Build documentation (PR, no deploy) — i.e. mkdocs build succeeds with the new override. Deploy jobs correctly skipped on a PR.

Scope — verified, not taken on faith

  • releases/latest 404 (the actual fix). docs/_overrides/partials/source.html is a genuinely new file (confirmed 404 on master). It reproduces Material's stock source partial — config.repo_url link, repo icon, config.repo_name — and removes only the data-md-component="source" attribute. That attribute is the marker Material's bundled JS keys off to fetch GitHub source-facts (stars/forks/latest-release). Dropping it stops the unauthenticated GET …/releases/latest call entirely, eliminating the 404 and the anonymous rate-limit exposure.
  • new URL TypeError genuinely already fixed on master. Confirmed by reading the existing docs/_overrides/partials/javascripts/outdated.html on master: it emits new URL("{{ base_url }}", location) — the location base argument is present. So no new code is needed for issue (1); a rebuild/redeploy from this PR clears it from the stale live deployment. Claim holds.

Side-effects — header/layout preserved

  • Repository link, icon and name are all retained; only the API-trigger marker is gone. Material's stock partial renders no version/facts text server-side either (the JS does), so removing the JS hook drops only the broken/empty facts — no visible header regression.
  • lang.t('source') resolves via the including context (header.html imports lang with context), which is why mkdocs build succeeds — confirmed by the green docs-build check.
  • No other docs behavior touched (single new override file; the only remaining network entry the author observed is the consent-gated GA collect abort, which is expected privacy behavior).

Verdict

Correct root-cause fix for the 404, accurate diagnosis that the TypeError is pre-fixed, minimal and theme-faithful, build verified green. Approve.

@Chisanan232 Chisanan232 marked this pull request as ready for review June 26, 2026 06:45
@Chisanan232 Chisanan232 merged commit 45761be into master Jun 26, 2026
4 checks passed
@Chisanan232 Chisanan232 deleted the v0.0.1/AAASM-3785/fix_docs_version_url_error branch June 26, 2026 07:02
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.

1 participant