SPA mode server build contains unnecessary SSR code
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Start
Describe the bug
When running tanstack start in SPA mode, the server build contains SSR code.
Your Example Website or App
Steps to Reproduce the Bug or Issue
Add
spa: {
enabled: true,
}
to the tanstackStart vite plugin config
Run npm build
The built .output/server contains code that would be used to server side render the application. However this isn't actually used at runtime.
Expected behavior
The built .output/server only contains the code needed to run server functions/api routes, so it is as slim as possible.
Screenshots or Videos
No response
Platform
- Start Version: 1.131.31
- OS: macOS
- Bundler: vite
- Bundler Version: 7.1.3
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the tanstackStart Vite plugin's spa.enabled option and npm build. Inspect the generated .output/server and trace which SSR code enters the build; done means the server output retains only code needed for server functions and API routes, without unused SSR code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- backend, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100