-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Open
Labels
MiddlewareRelated to Next.js Middleware.Related to Next.js Middleware.
Description
Link to the code that reproduces this issue
https://github.com/vanruch/next-repro - result of running npm create next-app --example auth next-repro
To Reproduce
- Create create simple middleware.ts
- Run npx @next/codemod@latest middleware-to-proxy
- File is not renamed
Current vs. Expected behavior
Expected middleware.ts to be renamed to proxy.ts
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:50 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6030
Available memory (MB): 18432
Available CPU cores: 12
Binaries:
Node: 23.11.1
npm: 10.9.2
Yarn: 1.22.22
pnpm: 9.14.3
Relevant Packages:
next: 16.0.3
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
If there're no changes necessary in the middleware file, the codemod returns in this line
https://github.com/vercel/next.js/blob/canary/packages/next-codemod/transforms/middleware-to-proxy.ts#L78
And the file rename in line 85 is skipped
Metadata
Metadata
Assignees
Labels
MiddlewareRelated to Next.js Middleware.Related to Next.js Middleware.