Skip to content

Bug: Next.js 16 deprecated middleware.ts causing broken proxy.accessibility.test.ts #4839

@Aamod007

Description

@Aamod007

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

  1. Rename middleware.ts in the project root to proxy.ts.
  2. Ensure proxy.accessibility.test.ts properly imports and tests the renamed module.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions