I-MOVED COURSE GUIDE

I Moved Off of Next.js

A chapter-by-chapter readback of the free course by Theo - t3․gg on Theo - t3․gg.

Length52:29
Chapters15
Modules6
Plain Markdown with clickable timestamps — drops into Obsidian, Notion or GitHub as-is.

This isn't a 'Next.js is bad' take — it's an insider's account of what happens when a client-focused app outgrows its framework, including the production failures at ~60% rollout and the Nitro workaround that saved the migration.

Who it's for
Read this guide if
  • You're weighing Next.js against TanStack Start for a client-heavy app
  • You run a real production app on Vercel and care about deploy sync, fluid compute, and scaling quirks
  • You want the honest, non-marketing story behind a framework migration
Skip ahead if
  • You're looking for a step-by-step migration tutorial
  • You want a blanket framework recommendation — Theo explicitly refuses to give one
  • You expect this to be about the recent Next.js exploit — it isn't
In brief
  • 52 minutes across 6 modules and 15 chapters
  • Tools covered: Next.js, TanStack Start, React Router, Vite, Hono, Convex, Nitro, tRPC, Dexie/IndexedDB
  • Migration PR: ~14,000 lines added, ~10,000 removed, reviewed via Graphite
  • Level: intermediate-to-advanced; assumes familiarity with React, Vercel, and modern meta-frameworks
  • Focus: production war story and architectural trade-offs, not a beginner course

The walkthrough

Each chapter below is our original written explanation of what happens at that moment in the video — a paraphrase, not a transcript. Click any timestamp to jump the player.

Why T3 Chat Was Built the Way It Was

0:00

Introduction

Theo announces T3 Chat has moved off Next.js to TanStack Start via a massive migration PR with 478 comments and roughly 14,000 lines added. He stresses the reasons were unusual and not the typical Next.js complaints.

3:31

The Original Goals and Requirements

T3 Chat was built for maximum speed and scalability in both deployment and codebase. A key requirement was keeping backend and frontend perfectly in sync, since a custom sync engine meant version mismatches could lose user data.

5:31

Choosing Next.js, React, and Dexie

The original stack: Next.js for easy combined deploys, React because the team knew it, and Dexie over IndexedDB for client storage. Theo explains why 'in sync' deployments made rollbacks and versioning far simpler than split projects.

Life Inside the Next.js Hacks

10:14

Hacking React Router into Next.js

The Next.js router wasn't designed for client-only apps, so T3 Chat used rewrite rules to serve a single static app shell with React Router. Theo shows how the entire client was one empty-div file, and why these header-based rewrite hacks caused constant unpredictable issues.

15:26

The Failed Migration Attempts: Remix, React Router, Vite + Hono

Attempts to leave Next.js kept failing: Remix broke on Cloudflare deployment inconsistencies, React Router's server edition was under-documented, and Vite + Hono on Cloudflare hit undocumented tooling and worker size limits of 3–10 MB.

20:06

Why Cloudflare Didn't Work

Server-side packages and image compression blew past Cloudflare's request caps, and splitting into many workers per route risked frontend/backend desync. With a tiny team and Vercel's fluid compute already in place, alternatives offered more work for little gain.

The Move to TanStack Start

22:03

Tanner's Early PR and the Real Motivation

Tanner Lunsford opened a TanStack Start PR back in February, but it died as the codebase moved too fast. Theo clarifies the migration wasn't about the exploit — the goal was escaping the awkward Next.js + React Router hybrid.

24:16

Honest Assessment of Next.js

Theo praises Next.js's exceptional backwards compatibility, noting a Next 10 to 16 upgrade was nearly seamless. He believes pushing for SPA support might have worked, but wanted a fresh start — and real bugs came from his sync engine, not the framework.

28:18

The Migration PR and New Routing

Julius led the rewrite: ~14,000 lines added and ~10,000 removed, made reviewable via Graphite's UI. The new routing uses TanStack Router, which generates route files automatically while maintaining full type safety.

Inside the TanStack Setup

30:45

Router Setup and Generated Route Trees

The dev server auto-rewrites route files to keep types accurate, and the generated routeTree.gen.ts is committed to the repo. Setup wires in Convex, tRPC, and Effect clients so server and client share data safely.

32:04

Type-Safe Routes and Params

Route params are inferred from path strings, so renaming a param triggers type errors. A TanStack route guarantees loaded data, letting components safely assume queries like getThreadById have already resolved.

Production Crisis and the Nitro Solution

34:58

The Fetch-Failed Crisis at Scale

At ~60% rollout, deployments crashed with 'TypeError: fetch failed' from Node's undici fetch. Suspecting TanStack's lazy route bundling at tens of thousands of routes, the team stopped trusting TanStack route resolvers for API endpoints.

38:38

Running APIs as Nitro Functions

With help from Vercel's Pooya (creator of Nitro), Julius patched TanStack Start to export h3 event bindings and moved all API endpoints into separate Nitro functions — effectively recreating the old Vite + Hono plan inside the framework.

40:43

Deployment Hacks, maxDuration, and Fluid Compute

Hacks remained but became less scary: a maxDuration of 799 (versus 800) dedicates Lambdas to the chat route under fluid compute. Theo also discusses the team's SSR decision, which he argued against but ultimately backed.

Verdict and Lessons

50:18

The Real Wins and the Honest Takeaway

The biggest win is that the code now belongs to the team rather than to Theo's personal hacks. Theo concludes that at scale your team matters more than any framework, and warns that 'just switch to X' claims are sales pitches — no stack is an obvious winner.

Moment by moment

TimeWhy it matters
15:26The stack timeline reveals every failed alternative — Remix, React Router server, Vite + Hono on Cloudflare
28:18Inside the 14,000-line migration PR and how Graphite made it reviewable
34:58The production-breaking 'fetch failed' error at 60% rollout — the migration's darkest moment
38:38The Nitro solution: running APIs outside TanStack Start with patched h3 event bindings
51:01Theo's core lesson: your team matters more than the framework

Do this next

  1. Audit your own app: are you using your meta-framework's router in a way it was designed for, or fighting it with rewrites and hacks?
  2. Read TanStack Start's docs on Nitro deployment and route generation to see if its primitives fit a client-heavy architecture
  3. Before any framework migration, list your hard requirements — deploy sync, rollback story, worker size limits — and test them in a prototype PR first

Common questions

Did the Next.js exploit cause this migration?

No. Theo explicitly says the migration is unrelated to the exploit and the surrounding drama. Alternatives to Next.js had been explored as far back as February, and the real motivation was that Next.js's router never fit a client-focused app.

How big was the TanStack Start migration?

The main PR by Julius added roughly 14,000 lines and removed about 10,000, with 478 comments. GitHub's review UI couldn't handle it, so the team used Graphite to make the giant PR reviewable.

What went wrong after the migration shipped?

At around 60% rollout, deployments crashed with 'TypeError: fetch failed' from Node's internal undici fetch, likely caused by TanStack's route bundling at scale. The team responded by moving all API endpoints off TanStack routes and into separate Nitro functions.

Does Theo recommend leaving Next.js for TanStack Start?

No — he offers no stack recommendation at all. He says he's had enough problems with every stack that there's no obvious choice, and claims that any framework solves your problems are lies or sales pitches.

Spot a mistake?

Every chapter summary on this page is hand-checked against the video, but timestamps and technical details can still slip through. If you spot an error, email us and we'll verify it against the source.

More course guides