YYour Name
  • Home
  • Experience
  • Work
  • Blog
  • Contact
  • Home
  • Experience
  • Work
  • Blog
  • Contact

© 2026 Cyborged. All rights reserved.

Cyber Security Anthusiast & Fullstack Web Developer

Back to blog
Next.jsTypeScriptDX

The case for typed routes in Next.js 14

Why I enable the typedRoutes experimental flag in every project now, and how it catches an entire class of bugs at compile time.

March 22, 2024
5 min read
All posts

The case for typed routes in Next.js 14

One of the most underrated features in Next.js 14 is the typedRoutes experimental flag. Enable it with one line in next.config.ts:

experimental: { typedRoutes: true }

Once enabled, every <Link href="...">, useRouter().push(...), and redirect(...) call becomes type-checked against your actual file system routes.

The Problem It Solves

Without typed routes, you can ship broken links silently:

// This compiles fine but 404s at runtime
<Link href="/experiance">Experience</Link>
//             ↑ typo

With typed routes enabled, that line becomes a compile error. The DX is similar to tRPC for API calls — your editor tells you immediately when a route doesn't exist.

The Tradeoff

The only cost is a slightly slower initial build as Next.js generates the route type manifest. On a project with ~30 routes, this adds roughly 2 seconds to next build. Worth it.