fix(website): force-static docs pages so components prerender - #4090
Closed
Adebesin-Cell wants to merge 1 commit into
Closed
Adebesin-Cell wants to merge 1 commit into
Adebesin-Cell wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Adebesin-Cell has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Collaborator
Author
|
Closing in favor of #4091. |
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.
📝 Description
Fixes the docs site 500ing on component pages in production.
/docs/[...slug]is opted into static generation so every page prerenders.⛳️ Current behavior
The route has
generateStaticParamsreturning all pages (confirmed: 54 components × 4 frameworks), but under the defaultdynamic = 'auto'Next prerendered only a couple of component pages (fieldset,overview) and served the rest on demand (ƒ). Those dynamically-rendered pages 500 in the Vercel runtime, so every component page (dialog, tabs, navigation-menu, …) returned a server error. It worked innext devand even in a localnext start, which is why it only showed up on the deploy.🚀 New behavior
export const dynamic = 'force-static'on the docs route. All 216 component pages now prerender to static HTML (verified:dialog.html,navigation-menu.html, … exist; served withx-nextjs-prerender: 1,x-nextjs-cache: HIT, 200). No page needs per-request data — the content is fully static — so forcing static is safe and also makes the docs faster.🧩 Frameworks
💣 Is this a breaking change (Yes/No): No
✅ Checklist
📝 Additional information
Diagnosed by instrumenting
generateStaticParams(it returns all 54 components) and rebuilding withdynamic = 'error', which built cleanly and prerendered all 216 pages — proving the pages are static-capable andautowas needlessly demoting them.force-staticis the safe production directive;errorwould also work and would additionally fail the build if a docs page ever became dynamic again.