fix(vercel): strip trailing slash from prerendered route overrides#4412
fix(vercel): strip trailing slash from prerendered route overrides#4412thribhuvan003 wants to merge 1 commit into
Conversation
|
@thribhuvan003 is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis change updates Vercel prerender override path normalization to remove trailing slashes and adds regression coverage for a prerendered ChangesVercel override path handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Linked issue
resolves #4392
❓ Type of change
📚 Description
prerendering a route with a trailing slash (e.g.
/slash/) emits a Build Output override whosepathkeeps the slash —"slash/index.html": { "path": "slash/" }— and vercel doesn't match override paths like that, so the route falls through to the server function instead of being served statically (repro + live deploy in #4392).this strips the trailing slash the same way the leading one is already stripped, so the override becomes
"path": "slash". the root route is unaffected (/still maps to""). extended the vercel:web preset test with a prerendered/slash/route.the same line exists on the v2 branch (
src/presets/vercel/utils.ts:166) — happy to open a backport if useful.📝 Checklist