Description
Next.js 16.2.7 has deprecated the middleware.ts file convention in favor of proxy.ts. During the build process, the following warning is emitted:
⚠ The middleware file convention is deprecated. Please use proxy instead.
Additionally, the test suite currently contains proxy.accessibility.test.ts which explicitly attempts to import from ./proxy. Because the file has not yet been renamed from middleware.ts, the npm run typecheck and npm run test pipelines fail with TS2307: Cannot find module './proxy'.
Impact
- Build pipelines are cluttered with deprecation warnings.
- CI/CD pipelines fail entirely due to the missing module import in the test suite.
Suggested Fix
- Rename
middleware.ts in the project root to proxy.ts.
- Ensure
proxy.accessibility.test.ts properly imports and tests the renamed module.
Description
Next.js 16.2.7 has deprecated the
middleware.tsfile convention in favor ofproxy.ts. During the build process, the following warning is emitted:⚠ The middleware file convention is deprecated. Please use proxy instead.Additionally, the test suite currently contains
proxy.accessibility.test.tswhich explicitly attempts to import from./proxy. Because the file has not yet been renamed frommiddleware.ts, thenpm run typecheckandnpm run testpipelines fail withTS2307: Cannot find module './proxy'.Impact
Suggested Fix
middleware.tsin the project root toproxy.ts.proxy.accessibility.test.tsproperly imports and tests the renamed module.