Skip to content

fix(docs): register loadingIcon cast so the Empty page prerenders (unbreak Pages deploy)#282

Merged
IgorShevchik merged 1 commit into
mainfrom
fix/docs-empty-loading-icon-cast
Jul 15, 2026
Merged

fix(docs): register loadingIcon cast so the Empty page prerenders (unbreak Pages deploy)#282
IgorShevchik merged 1 commit into
mainfrom
fix/docs-empty-loading-icon-cast

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Problem

The Deploy to Pages workflow has failed on every run since #577 (80ab3e4a, PR #275 feat(Empty): add loading and loadingIcon props). The last green deploy was #576 (PR #274). CI aborts in the Generate Docs step:

Errors prerendering:
  ├─ /b24ui/docs/components/empty/ (20839ms)
  │ ├── [500] Server Error
[error] Exiting due to prerender errors.

/docs/components/empty/ is the only failing route — every other page prerenders fine (all the "Linked from …" lines are just pages that link to it). My recent sync PRs (#279/#280/#281) merely inherited an already-broken main; they didn't cause this.

Root cause

PR #275's ported "Loading Icon" example uses:

cast:
  loadingIcon: 'LoaderClockIcon'

but LoaderClockIcon was never added to the docs castMap (in ComponentCode.vue and server/utils/transformMDC.ts). An unregistered cast hits:

if (cast && !castMap[cast]) throw new Error(`Unknown cast: ${cast}`)

during SSR → Nitro reports [500] and exits with prerender errors.

b24ui docs deliberately expose one registered demo-icon cast — RocketIcon — and every other icon example uses it (convertIcon hardcodes it in each branch). LoaderClockIcon was an un-adapted leftover from the upstream port.

Fix

  • empty.md — cast loadingIcon via the registered RocketIcon.
  • ComponentCode.vue + transformMDC.ts — add loadingIcon to iconsTypeList and convertIcon, so the example's displayed code shows :loading-icon="RocketIcon", consistent with the live preview (matching the existing icon/trailing-icon/… handling).

Audited all docs content: after this change, the only icon cast referenced anywhere is RocketIcon (registered) — no other latent unregistered-cast 500s.

Verification

Local full nuxt generate docs can't complete in the sandbox (ulimit -Hn is 4096 → EMFILE in @nuxtjs/mdc), but across runs the prerender reached 774 routes with zero Unknown cast/[500] errors — the empty-page crash no longer occurs. The authoritative check is this PR's Deploy to Pages run, which has the fd headroom to complete the prerender (pre-fix it finished the full crawl and failed only on the empty-page cast).

🤖 Generated with Claude Code


Generated by Claude Code

The Pages deploy has failed since PR #275 (feat(Empty): add loading and
loadingIcon props). The docs generate aborted with a [500] Server Error while
prerendering /docs/components/empty/ — the sole failing route.

Root cause: the Empty "Loading Icon" example uses `cast: loadingIcon:
'LoaderClockIcon'`, but `LoaderClockIcon` was never registered in the docs
`castMap` (client ComponentCode.vue and server transformMDC.ts). The unknown
cast hits `throw new Error('Unknown cast: ...')` during SSR, which Nitro
surfaces as a 500 and then exits with prerender errors.

b24ui docs use a single registered demo-icon cast, `RocketIcon` (every other
icon example uses it; `convertIcon` hardcodes it). Fix accordingly:

- empty.md: cast loadingIcon via the registered `RocketIcon`
- ComponentCode.vue + transformMDC.ts: add `loadingIcon` to `iconsTypeList`
  and `convertIcon` so the example renders `:loading-icon="RocketIcon"` in the
  displayed code, consistent with the live preview

Verified no other docs page references an unregistered cast.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik IgorShevchik merged commit 37ffe59 into main Jul 15, 2026
1 check passed
@IgorShevchik IgorShevchik deleted the fix/docs-empty-loading-icon-cast branch July 15, 2026 08:34
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.

2 participants