Railway Dumps Next.js: Builds Drop to 2 Mins

Everyone figured Next.js was frontend endgame. Railway said no—axed it completely, slashed builds to under two minutes, and shipped without a hiccup.

Graph showing Railway frontend build times dropping from over 10 minutes to under 2 with Next.js to Vite switch

Key Takeaways

  • Railway cut frontend builds from 10+ to under 2 minutes by ditching Next.js for Vite + TanStack Router.
  • Migration done in two PRs with zero downtime, showcasing their own platform's power.
  • Signals shift to client-first stacks for dashboards, predicting more teams will follow.

Next.js was supposed to be forever. Devs everywhere bought the hype: server-side rendering for all, Vercel-backed polish, millions of users hooked. Then Railway—the hotshot platform powering deploys for thousands—rips it out of their entire production frontend. Dashboard, canvas, railway.com: all now Vite + TanStack Router. Builds? From 10+ minutes to under two. This isn’t some side project tweak. It’s a full-throated rejection of the server-first orthodoxy, right when App Router was meant to seal Next.js’s throne.

And here’s the market shift it signals: client-heavy apps like dashboards are done pretending SSR fits. Railway serves millions monthly, ships multiple times daily. Those 10-minute builds—six from Next.js alone, mired in ‘finalizing page optimization’—weren’t cute. They were a tax killing velocity.

“Frontend builds had crept past 10 minutes. Six of those minutes were Next.js alone, half of it stuck on ‘finalizing page optimization.’”

Railway’s stack screams client-side: rich stateful dashboard, real-time canvas, websockets everywhere. Next.js’s server primitives? Unused. They hacked layouts atop Pages Router—workarounds galore. App Router? Tempting, but its server tilt clashes with their client-driven reality. Why rebuild for a mismatch?

Why Ditch Next.js for Vite + TanStack?

Look, Next.js launched them from zero to millions. Credit where due. But scale exposed cracks. Shared layouts? Hacky. Routing? Forced abstractions. Builds ballooned as the app grew complex.

TanStack Router flips it. Type-safe routing—params inferred, autocomplete tree-wide, file-system generated. First-class layouts, no hacks. Dev loop vanishes: instant HMR, zero startup. SSR? Only where it counts—marketing pages, changelog. Client-side purity elsewhere.

Explicit model, too. Less magic, more control. Team tried TanStack Start over holidays. Unanimous love. For a dashboard like theirs, enjoyment equals benchmarks.

The Insane Two-PR Migration

Months-long saga? Nope. Two pull requests. Zero downtime. PR1: Nuke Next.js deps—next/image, next/head, next/router. Swapped for browser natives or agnostics. Framework untouched.

PR2: Full swap. 200+ routes. Extracted logic to components, regenerated tree. Added Nitro server layer, consolidated 500+ redirects, headers, caching. Ditched Node polyfills for browser cleanups. Merged Sunday dawn. Discord war room, fixes streamed in. Dogfooded live.

That’s not luck. It’s preview deploys, health checks, zero-downtime rollouts—their own platform’s muscle flexed inward.

Trade-offs hit, sure. No built-in image opt—Fastly edge now. Ecosystem bits like next-seo? In-house minis. Maturity? TanStack’s young, rough edges. But Railway sponsors Vite, TanStack. Direction’s dead right.

Is TanStack Router Production-Ready?

Skeptics gonna skeptic. New stack on millions-scale prod? Ballsy. But data backs it: sub-2-minute builds, same-day ship. No infra tweaks needed—they run prod like users do.

My take? This echoes 2016’s Angular fatigue. Bloated metaframeworks choked velocity; Svelte, Solid rose on lightness. Next.js feels that now—server bloat for client apps. Bold prediction: by 2025, 30% of dashboard teams follow. Client-first primitives win when SSR’s a vestige.

Railway’s PR spin calls it ‘explicit, fast.’ Fair, but undersells. They’re betting against Vercel’s gravity well. If builds stay fast, velocity soars—churn drops, hires stick. Metrics will tell.

Numbers don’t lie. Railway’s monthly users: millions. Deploys: multiple daily. Pre-migration tax: 10+ minutes per iteration. Post: under 2. That’s 80%+ timeback, compounded across team.

Vercel won’t blink publicly—$3B+ valuation cushions. But whispers grow. Client apps bloating under Next? Check Twitter. This migration’s a flare.

Why Does This Matter for Frontend Teams?

You’re not Railway. Still. If your dashboard’s client-fat, SSR-forcing frameworks drag. Measure your builds. Stuck finalizing pages? Time to audit.

TanStack’s not solo. Vite’s ecosystem booms—3M+ weekly npm. TanStack Router v1 just hit stability. Momentum’s there.

Critique their hype? ‘We enjoy it.’ Vague. But actions scream: two PRs prove conviction. No parallel run months. Deadline-driven ripcord.

Historical parallel: Basecamp ditched Rails for Hotwire. Velocity exploded. Same here—framework swap unlocks human limits.

Teams chasing Next.js sheen? Pause. Match stack to app. Client-first? Go explicit.

Build times now dictate devops moats. Railway eats their dogfood; others will chase.


🧬 Related Insights

Frequently Asked Questions

What made Railway switch from Next.js?

Builds hit 10+ minutes, mostly Next.js overhead. Their client-heavy dashboard didn’t need server-first patterns—hacks piled up.

How did Railway migrate without downtime?

Two PRs: first stripped Next.js deps, second swapped framework. use their own preview deploys and zero-downtime tools.

Is TanStack Router better than Next.js?

For client-driven apps like dashboards, yes—faster builds, type-safe routing, true layouts. Trade ecosystem maturity.

James Kowalski
Written by

Investigative tech reporter focused on AI ethics, regulation, and societal impact.

Frequently asked questions

What made Railway switch from Next.js?
Builds hit 10+ minutes, mostly Next.js overhead. Their client-heavy dashboard didn't need server-first patterns—hacks piled up.
How did Railway migrate without downtime?
Two PRs: first stripped Next.js deps, second swapped framework. use their own preview deploys and zero-downtime tools.
Is TanStack Router better than Next.js?
For client-driven apps like dashboards, yes—faster builds, type-safe routing, true layouts. Trade ecosystem maturity.

Worth sharing?

Get the best AI stories of the week in your inbox — no noise, no spam.

Originally reported by Hacker News

Stay in the loop

The week's most important stories from theAIcatchup, delivered once a week.