TanStack / TanStack/router

Start: Dev server takes 5-12s to boot on fresh/cold start (SPA mode, Vite 8)

Open
#7,091 7 comments 8 reactions 0 assignees View on GitHub

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

The first bun run dev command, or running it after a period of inactivity, takes 5–12 seconds to boot the dev server. Subsequent runs are fast, but any cold start (e.g. after rm -rf node_modules && bun install) consistently shows this delay.

I'm unsure whether this is a Vite 8 issue or a general TanStack Start problem. However, this occurs with a very simple fresh project.

I'm using a MacBook M3 Pro, so I don't believe this is a device-related issue.

Note: I am using SPA mode.

Your Example Website or App

https://github.com/abed-daloopa/tanstack-start-dev-server-slow-start

Steps to Reproduce the Bug or Issue
  1. Clone the repo: git clone https://github.com/abed-daloopa/tanstack-start-dev-server-slow-start
  2. cd tanstack-start-dev-server-slow-start
  3. rm -rf node_modules
  4. bun install
  5. bun run dev
  6. Observe the startup time
Expected behavior

The dev server should start more quickly

Screenshots or Videos
Image
Platform
  • Start Version: 1.167.16
  • Router Version: 1.168.10
  • Router Plugin Version: 1.167.12
  • OS: macOS (Apple M3 Pro)
  • Bundler: Vite 8.0.3
  • Runtime: Bun
Additional context
  • This happens consistently on cold starts (after clearing node_modules or after a period of inactivity).
  • Warm/subsequent starts are noticeably faster.
  • The project is minimal, essentially a fresh TanStack Start setup with SPA mode enabled.
  • Could potentially be related to Vite 8 or the router plugin initialization.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository and run the listed rm -rf node_modules, bun install, and bun run dev steps. Compare cold and warm startup times while investigating whether Vite 8 or router plugin initialization accounts for the delay. Done means identifying the responsible initialization path and demonstrating a faster cold start with regression coverage if applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, typescript, vite
Domain
build-system, developer-experience, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.