Skip to content

[TOC] Fix 56 rendered-heading scrape failures from deprecated container renderer imports - #32580

Open
mvvmm wants to merge 1 commit into
productionfrom
fix/toc-scrape-renderer-imports
Open

[TOC] Fix 56 rendered-heading scrape failures from deprecated container renderer imports#32580
mvvmm wants to merge 1 commit into
productionfrom
fix/toc-scrape-renderer-imports

Conversation

@mvvmm

@mvvmm mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What changed

src/util/rendered-toc.ts used the deprecated loadRenderers([getContainerRenderer()]) + AstroContainer.create({ renderers }) API to render MDX pages at build time for TOC heading extraction. This path failed with ERR_UNSUPPORTED_ESM_URL_SCHEME: Received protocol 'astro:' for 56 pages that use AnchorHeading (which emits headings at runtime via set:html).

Replaced with AstroContainer.create({}) + container.addServerRenderer() using direct server.js imports — the same pattern already used in src/util/container.ts.

Results

Metric Before After
TOC scrape failures 56 0
Deprecated renderer import type hints 4 0
Pages built 8,802 8,802

Checklist

  • pnpm run check — 0 errors
  • pnpm run build — 8,802 pages, no new warnings
  • pnpm exec prettier — clean

@github-actions github-actions Bot added the size/s label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
*.ts @cloudflare/content-engineering, @kodster28

@mvvmm

mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/rebase

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review

✅ No issues found in commit 399aae8.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

No code review issues found.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

…renderer imports

Replace deprecated loadRenderers([getContainerRenderer()]) +
AstroContainer.create({ renderers }) with AstroContainer.create({}) +
container.addServerRenderer() using direct server.js imports, matching
the pattern already used in src/util/container.ts.

The deprecated loadRenderers/getContainerRenderer API path failed with
ERR_UNSUPPORTED_ESM_URL_SCHEME (protocol 'astro:') for 56 pages using
AnchorHeading. The addServerRenderer approach properly registers
renderers without triggering the astro: virtual import resolution failure.

Results:
- TOC scrape failures: 56 → 0
- Deprecated renderer import type hints: 4 → 0
- No new build warnings, 8802 pages built successfully
@cloudflare-docs-bot
cloudflare-docs-bot Bot force-pushed the fix/toc-scrape-renderer-imports branch from 6610f1e to 399aae8 Compare August 6, 2026 22:30
@mvvmm
mvvmm marked this pull request as ready for review August 6, 2026 22:31
@mvvmm
mvvmm requested a review from a team as a code owner August 6, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants