Menu

1 / 5

Next.js Middleware to Proxy: How to Migrate middleware.ts to proxy.ts in Next.js 16

#devcommunity#dev#proxy#middleware#next
Reading 0:00
15s threshold

Cross-posted from my blog. The original, with any updates, lives on fabwaseem.com .

In Next.js 16, middleware.ts is deprecated and renamed to proxy.ts . Your existing middleware still runs, but every build now prints a deprecation warning, and a few things behave differently: the function name changes, Proxy always runs on the Node.js runtime, and having both files in a project fails the build. This guide covers the Next.js middleware to proxy migration step by step, with the exact warnings and errors I got from Next.js 16.4.5 on a small test app, so you know what to expect before you run the codemod.

Next.js middleware vs proxy: what actually changed

The behavior is the same feature under a new name.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.