fix: vite preview base path support#6304
Conversation
📝 WalkthroughWalkthroughThis change adds custom base path support to the TanStack Start prerender and preview server workflows. Configuration examples are updated with a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (7)📓 Common learnings📚 Learning: 2025-12-21T12:52:35.231ZApplied to files:
📚 Learning: 2025-10-01T18:30:26.591ZApplied to files:
📚 Learning: 2025-12-24T22:47:44.320ZApplied to files:
📚 Learning: 2025-12-17T02:17:55.086ZApplied to files:
📚 Learning: 2025-12-06T15:03:07.223ZApplied to files:
📚 Learning: 2025-10-08T08:11:47.088ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
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 |
|
View your CI Pipeline Execution ↗ for commit b6f260e
☁️ Nx Cloud last updated this comment at |
|
this looks good. I've resolved the prettier error on the import orders and merged main that includes updates for the failures on react-start-basic raw stream tests (these were flaky and was not due to any changes in this PR) |
* fix: vite preview base path support * fix: base name with trailing slash support * update example for demo purpose * prettier: resolve import order --------- Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com> Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
Fix #6023
It seems like the Vite preview server currently strip out the base path from the request URL. This prepends it back to restore the actual URL that hits the preview server.
We are also enforcing trailing slash to the prerendering requests so we won't get a 404 response when base path has a trailing slash.
One thing I am not sure though is the log output. The prerendered pages is not actually saved in a
testfolder but the logs makes it looks like that when I verify it with the start-basic-static example.Summary by CodeRabbit
Release Notes
/test/), enabling better flexibility for hosting configurations and routing resolution across the application.✏️ Tip: You can customize this high-level summary in your review settings.