fix(redirects): remove trailing-slash duplicates to fix build OOM#255
Merged
Conversation
The Stainless Docs Build CI check was failing with "Ineffective
mark-compacts near heap limit" because Astro was registering 50+ routes
twice (once as /foo and once as /foo/) due to redirect entries that
defined both source-key forms. With astro `trailingSlash: "never"`,
both forms normalize to the same canonical route and collide.
Vercel already strips trailing slashes from incoming URLs at the
platform level (vercel.json `trailingSlash: false`), so the
trailing-slash source keys were never actually firing in production
anyway -- they were dead config that doubled build work and triggered
the route-collision warnings ("A collision will result in a hard error
in following versions of Astro").
Removed all 52 trailing-slash source keys. User-visible behavior is
unchanged: Vercel normalizes /foo/ -> /foo before redirect rules apply,
then the no-slash entry fires.
Six entries had different destinations between their no-slash and
trailing-slash forms (e.g. /learn/data-management/data-retention vs
/learn/data-management/data-retention/) -- those trailing-slash
destinations were already dead in production due to Vercel's
normalization, so removing them aligns config with actual behavior.
Verified locally with DOCS_LOCAL_WITHOUT_STAINLESS=1 pnpm build:
- Before: ~138s, OOM at 2GB heap
- After: 46s, 692 pages built cleanly
- Route-collision warnings: 100+ -> 0
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Checklist CompleteThank you for taking the time to properly review your PR! All checklist items are complete. |
atovpeko
approved these changes
May 7, 2026
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.
Describe your changes
The Stainless Docs Build CI check has been failing on every PR with
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory. Root cause: Astro was registering 50+ routes twice (once as/fooand once as/foo/) due to redirect entries that defined both source-key forms. Withastro trailingSlash: "never", both forms normalize to the same canonical route and collide — doubling build work and pushing Node's heap past the 2GB limit.Vercel already strips trailing slashes from incoming URLs at the platform level (
vercel.jsontrailingSlash: false), so the trailing-slash source keys were never actually firing in production — they were dead config that was triggering the route-collision warnings (which Astro will turn into a hard error in a future release).What I changed: Removed all 52 trailing-slash source keys from the
redirectsblock inastro.config.ts. Added a short comment explaining the convention (no-trailing-slash sources only).User-visible behavior is unchanged: Vercel normalizes
/foo/→/foobefore redirect rules apply, then the no-slash entry fires. Six entries had different destinations between their no-slash and trailing-slash forms (e.g./learn/data-management/data-retentionvs/learn/data-management/data-retention/) — those trailing-slash destinations were already dead in production due to Vercel's normalization, so removing them aligns config with actual behavior.Build verification (
DOCS_LOCAL_WITHOUT_STAINLESS=1 pnpm build):Follow-up worth tracking separately (not part of this PR): Two unrelated route conflicts surfaced in the build log where a real MDX file is shadowed by a redirect targeting its own path:
/learn/continuous-aggregates/about-continuous-aggregates/learn/data-management/data-lifecycleEither the redirect or the MDX should go in each case.
Affected pages
No content pages affected by this PR. Open the preview to confirm the build deployed successfully.
Related Issues
Issue: #number
Checklist before requesting a review