Urgent.News

What's breaking now, across thousands of outlets.

Tech

Migrating to Next.js 15: big wins, small gotchas

TL;DR Next.js 15 delivers massive developer-velocity wins (stable Turbopack in dev, React 19 support, Partial Prerendering) but introduces two migration hotspots: async request-scoped APIs (cookies(), headers(), params, searchParams) and inverted fetch/GET caching defaults. Enable Turbopack, audit request-scoped APIs for awaits, and make caching explicit route-by-route. Why we upgraded:…

Next.js 15 provides significant improvements in developer velocity, including a stable Turbopack in development mode, support for React 19, and Partial Prerendering (PPR). However, the migration introduces two main challenges: request-scoped APIs now return Promises, and fetch/GET route handlers are uncached by default.

To address the request-scoped APIs, use the async version of the helpers (cookies(), headers(), params, searchParams) and ensure callers are async as well. This can be automated with the official codemod, but manual review is still required for complex patterns. For fetch() and GET route handlers, explicitly set caching options using cache: "force-cache" for static resources or next: { revalidate: seconds } for Incremental Static Regeneration (ISR) behavior.

The migration also encourages moving more UI to Server Components and adopting PPR to reduce client bundle size and improve performance. After upgrading, run the codemod, audit request-scoped APIs and fetches, decide caching strategies, enable Turbopack in dev mode, and test thoroughly. Monitoring production is recommended to catch any unintended performance regressions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Friday 18 September →