Next.js 16 Renames middleware.ts to proxy.ts: What Teams Need to Know
Next.js 16 introduced proxy.ts as the replacement for middleware.ts, the file responsible for intercepting requests before any application code runs. The framework kept the old filename functional during the transition, causing many teams to miss the change entirely after upgrading. Unlike its predecessor, proxy.ts no longer gives developers a choice of runtime, removing the Edge-only constraint that had shaped how auth and redirect logic was written for years. Developers can migrate existing middleware.ts files using an official codemod that also handles renamed configuration options. Teams running both filenames in the same codebase after a partial migration risk inconsistent request-handling behavior that may be difficult to detect.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in