fix(docs): pre-render default locale only to fix Vercel build OOM#684
Closed
berry-13 wants to merge 2 commits into
Closed
fix(docs): pre-render default locale only to fix Vercel build OOM#684berry-13 wants to merge 2 commits into
berry-13 wants to merge 2 commits into
Conversation
… OOM Publishing all 13 locales (#683) grew the [lang]/docs/[[...slug]] route from ~1,080 to ~2,340 pre-rendered pages, which exhausted the 8 GB Vercel build runner (OOM around 10-15 min, or the 45-minute build timeout). Pre-render the default language only and let localized docs render on demand (dynamicParams, already the default) and edge-cache on first hit, so build cost stays flat as more languages are added. An untranslated locale still redirects to English in Page(); hreflang/canonical gating is unchanged. Also add a NODE_OPTIONS heap-headroom flag as a safety net for the webpack compile phase.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eea5dddb55
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Contributor
📦 Next.js Bundle Analysis for librechat.aiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Localized docs render on demand, so they aren't in the build output next-sitemap scans and dropped out of sitemap.xml while generateMetadata still advertises hreflang alternates to them. Enumerate the translated files (content/docs/<path>.<locale>.mdx) and add their URLs back via additionalPaths, at the same priority as English docs.
Contributor
📦 Next.js Bundle Analysis for librechat.aiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
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
Production builds on
mainfail since #683 (publishing 8 new locales). Theapp/[lang]/docs/[[...slug]]route pre-renders one page per (locale, doc), which jumped from ~1,080 to ~2,340 pages and exhausts the 8 GB Vercel build runner: sometimes a heap OOM at 10-15 min, sometimes the 45-minute build timeout. The site stays up on the last good deployment (#682), but the translations can't ship.Fix
generateStaticParamsnow returns just the default locale (~180 pages). Localized docs render on demand (dynamicParamsis the default, now explicit) and edge-cache on first hit via the existingcdnCacheHeaders. Build cost stays flat regardless of how many languages exist. Behaviour is otherwise unchanged: an untranslated locale still redirects to English inPage(), and hreflang/canonical gating is untouched.buildruns with--max-old-space-size=7168viacross-envas a safety net for the webpack compile phase.Verification
The Vercel preview build for this PR is the test: if it goes green, the OOM is resolved. After merge, sanity-check that a localized page (e.g.
/de/docs/...) renders on demand.If the preview still OOMs
That would mean the limit is the webpack compile phase (compiling all MDX modules), which this PR does not reduce. In that case bump the Vercel build machine to a larger tier and raise the
7168cap to match.