From 3ffab636ad14be92a38cbfdb78faa0a15395d903 Mon Sep 17 00:00:00 2001 From: "Alexis D." Date: Mon, 25 May 2026 20:06:50 +0200 Subject: [PATCH] fix(nextjs-turbopack): document proxy.ts middleware filename (#2033) Documents proxy.ts as the current Next.js/Turbopack middleware filename. --- skills/nextjs-turbopack/SKILL.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/skills/nextjs-turbopack/SKILL.md b/skills/nextjs-turbopack/SKILL.md index 8e528710..7cdf88b8 100644 --- a/skills/nextjs-turbopack/SKILL.md +++ b/skills/nextjs-turbopack/SKILL.md @@ -37,6 +37,19 @@ next start Run `next dev` for local development with Turbopack. Use the Bundle Analyzer (see Next.js docs) to optimize code-splitting and trim large dependencies. Prefer App Router and server components where possible. +## Middleware File Naming + +Next.js 16 introduced `proxy.ts` as the middleware filename, replacing the older `middleware.ts` convention: + +- **Next.js 16+**: use `proxy.ts` at the project root +- **Pre-Next.js 16**: use `middleware.ts` at the project root + +The filename change is tied to the **Next.js version**, not to which bundler (Turbopack or webpack) is in use. Always check the official docs for the version you are reviewing. + +**Do not flag `proxy.ts` as a misnamed or missing middleware file in Next.js 16 projects.** The file is correct and intentional. Suggesting a rename to `middleware.ts` will break middleware execution. + +Reference: https://nextjs.org/docs/app/getting-started/proxy + ## Best Practices - Stay on a recent Next.js 16.x for stable Turbopack and caching behavior.