Railway moves its frontend off Next.js — builds fall from 10+ minutes to under two

April 8, 2026
Elegant flat lay of a laptop and watch on a rustic wooden desk, ideal for productivity themes.
Photo by Polina ⠀ on Pexels

The switch in a nutshell

Railway's entire production frontend — the dashboard, canvas and railway.com — has been migrated off Next.js onto Vite + TanStack Router. It has been reported that frontend builds dropped from more than ten minutes to under two. That’s not a small win. For a team that ships multiple times a day, shaving away that wait is the difference between momentum and slog.

Why Next.js stopped fitting

Next.js "got us from zero to millions," the company notes, but it also started getting in the way. Builds were increasingly dominated by Next.js’s optimization steps, and Railway’s app is overwhelmingly client-driven: real‑time canvases, websockets, stateful dashboards. The Pages Router forced awkward layout workarounds, and the App Router — the supposed cure — leans hard into server-first patterns Railway doesn’t need. Friction piled up. It felt, the team says, like an expensive tax on every iteration.

Why TanStack Start + Vite

Railway picked a stack that mirrors how they actually build: explicit, client-first, and fast. The sell? Type-safe routing with inferred params, composable pathless layouts, instant HMR and near-zero startup time, and SSR only where it makes sense (marketing pages, changelog, careers). Developers tried TanStack Start over the holidays and liked it. Who can blame them — a snappy dev loop is a small happiness with outsized returns.

The cutover — two PRs, zero downtime

The migration was surgical. PR 1 removed Next.js-specific APIs (next/image, next/head, next/router) and replaced them with browser-native or framework-agnostic alternatives. PR 2 swapped the framework and re-generated 200+ routes after extracting non-routing logic into React components. It has been reported that the move required hundreds of commits and achieved zero downtime for millions of users. There were trade-offs — some Next.js conveniences and server-first primitives were left behind — but Railway chose control and iteration speed over framework magic. Sounds like a gamble that paid off.

Sources: railway.com, Hacker News