Await cookies, headers and draftMode

Proprietary

Next.js 15 made cookies(), headers() and draftMode() from next/headers asynchronous. Awaits each call in an async function, making a synchronous App Router page, layout or route handler async first. Elsewhere in synchronous TypeScript code, casts the call to its UnsafeUnwrapped type, the upgrade guide's temporary synchronous usage. Meant for projects on Next.js 15; run it through UpgradeToNextjs15 when upgrading.

io.moderne.nextjs.15.async-request-apis
mod run . --recipe=io.moderne.nextjs.15.async-request-apis

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.