Why I enable the typedRoutes experimental flag in every project now, and how it catches an entire class of bugs at compile time.
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.
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 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.