chore: migrate from middleware.ts to proxy.ts for Next.js 16 compatib…
…ility
Migrate from the deprecated middleware.ts file convention to the new proxy.ts convention as required by Next.js 16.0.10.
The middleware file convention has been deprecated and renamed to 'proxy' to better clarify its purpose as a network boundary in front of the app, and to avoid confusion with Express.js middleware.
Changes:
- Rename apps/site/middleware.ts to apps/site/proxy.ts
- Add named export const proxy = createMiddleware({
- Maintain full compatibility with next-intl internationalization
- Update comments to reflect proxy terminology
This resolves the deprecation warning: 'The middleware file convention is deprecated. Please use proxy instead.'
Refs: https://nextjs.org/docs/messages/middleware-to-proxy
Description
Validation
Related Issues
Fixed #8418
Check List
- [x] I have read the Contributing Guidelines and made commit messages that follow the guideline.
- [x] I have run
pnpm formatto ensure the code follows the style guide. - [x] I have run
pnpm testto check if all tests are passing. - [x] I have run
pnpm buildto check if the website builds without errors. - [x] I've covered new added functionality with unit tests if necessary.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Review | Updated (UTC) |
|---|---|---|---|
| nodejs-org | Preview | Dec 14, 2025 2:36pm |
👋 Codeowner Review Request
The following codeowners have been identified for the changed files:
Team reviewers: @nodejs/nodejs-website
Please review the changes when you have a chance. Thank you! 🙏
export const proxy = createMiddleware({You should just be able to do this, no?
I have done as per documentation, but let me try if this similer approch works
hi @avivkeller I amended the commit to incorporate this feedback. I've verified that both approaches work correctly, and all tests pass
The reference to this file in CODEOWNERS needs updating, please
okay checking that
The reference to this file in CODEOWNERS needs updating, please
hi @MattIPv4 I have done that please check if I have done it correctly or not
- apps/site/middleware.ts @nodejs/web-infra
+ apps/site/proxy.ts @nodejs/web-infra
The added comment is still not needed, you only removed half of it.
The added comment is still not needed, you only removed half of it.
yeah sorry about that check now f4507a886ae41f564729b0c843d3267b0bb4529b
Looks like Matt and Claudio still have concerns, but LGTM with my blockers
Not concerns. This actually cannot be merged, otherwise it breaks Cloudflare builds.
To be clear not against the changes, just, they cannot be merged meantime.
To be clear not against the changes, just, they cannot be merged meantime.
Okay 👍, I will try to remind you once Open Next Supports it
Thank you! You can keep the PR open although I'd recommend converting it back to a draft state.