Middleware
On Next.js 16 request interception moves to proxy.ts which runs on the Node.js runtime. Rename middleware.ts to proxy.ts and export a proxy function.
Next.js 16 renamed the middleware entry point to proxy.ts to make the network boundary explicit. proxy.ts runs on the Node.js runtime. You rename middleware.ts to proxy.ts then rename the exported function to proxy while the logic stays the same. The middleware.ts filename still works for Edge cases but is deprecated.