fix(redirects): serve legacy redirects in production via render.yaml#72
Merged
pete-vielhaber merged 1 commit intoJun 26, 2026
Merged
Conversation
Production runs on Render (a manually-created static site), which ignores vercel.json — so the redirects wired up in zerodevapp#71 never applied in prod. The live service also had broad SPA-fallback rewrites (/sdk/*, /react/*, /smart-wallet/*, /meta-infra/*, /recovery-flow/*) that, under Render's first-match-by-priority routing, swallowed ~145 of the 201 legacy URLs into the app shell (-> in-app 404). - render.yaml: Render Blueprint that adopts the existing "docs" static site. Generated redirects sit ABOVE the SPA-fallback rewrites so they take priority. - redirects.config.js stays the single source of truth; folds in /magic-account (collapsing its stale /sdk/advanced/chain-abstraction hop). - scripts/sync-render-redirects.mjs splices the generated block between sentinels, preserving the hand-maintained service def + fallbacks. Output is prettier-clean by construction. - CI (redirects-in-sync) + npm scripts now target render.yaml. - Remove the unused vercel.json and its sync script.
|
@a-thomas-22 is attempting to deploy a commit to the zero-dev1 Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 deploys on Render (a manually-created static site), not Vercel. Render ignores
vercel.json, so the 201 redirects wired up in #71 never took effect in prod — every legacy URL kept 404ing.Pulling the live service config revealed a second, deeper issue: the service already had broad SPA-fallback
rewriterules (/sdk/*,/react/*,/smart-wallet/*,/meta-infra/*,/recovery-flow/*→/index.html). Render applies the first matching rule by priority, top to bottom, so those wildcards sat above the redirects and swallowed ~145 of the 201 legacy URLs into the app shell (which then renders an in-app 404).Fix
Adopt the existing Render static site with a Blueprint and order the routes correctly.
render.yaml— Render Blueprint that adopts the existingdocsservice (matched byname; service def / build / domains / env mirror the live config). The generated redirects are emitted above the SPA-fallback rewrites so they win under first-match routing.redirects.config.jsstays the single source of truth. Folds in/magic-account→/smart-accounts/chain-abstraction/overview(the live rule pointed at/sdk/advanced/chain-abstraction, itself now legacy — collapsed the broken hop).scripts/sync-render-redirects.mjs— splices the generated block betweenBEGIN/ENDsentinels, preserving the hand-maintained service def + SPA fallbacks. Output is prettier-clean by construction (block style + double-quoted scalars = prettier's default YAML), so no.prettierignoreandnpm run formatleaves it alone..github/workflows/redirects-in-sync.yml+ npm scripts now regenerate and diffrender.yaml, failing the PR if it drifts fromredirects.config.js.vercel.jsonand its sync script.Deploy steps (Render)
render.yamllands onmain.zerodevapp/docs→ pick the branch.docsservice — not a new suffixed one (a suffix means thenamedidn't match). Existingsync: falseenv vars are preserved on adoption.render.yamlthen becomes the source of truth and pushes auto-deploy.Note
Render's
redirecttype is 301 (not configurable), so these are permanent/hard-cached — a behavior difference from the307the previous approach intended.Verify after deploy