fix(docs): register loadingIcon cast so the Empty page prerenders (unbreak Pages deploy)#282
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:/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-brokenmain; they didn't cause this.Root cause
PR #275's ported "Loading Icon" example uses:
but
LoaderClockIconwas never added to the docscastMap(inComponentCode.vueandserver/utils/transformMDC.ts). An unregistered cast hits: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 (convertIconhardcodes it in each branch).LoaderClockIconwas an un-adapted leftover from the upstream port.Fix
empty.md— castloadingIconvia the registeredRocketIcon.ComponentCode.vue+transformMDC.ts— addloadingIcontoiconsTypeListandconvertIcon, so the example's displayed code shows:loading-icon="RocketIcon", consistent with the live preview (matching the existingicon/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 docscan't complete in the sandbox (ulimit -Hnis 4096 →EMFILEin@nuxtjs/mdc), but across runs the prerender reached 774 routes with zeroUnknown 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