Back to feed
Dev.to
Dev.to
6/17/2026
I Got the proxy.ts Matcher Wrong for Three Projects Before I Understood Why

I Got the proxy.ts Matcher Wrong for Three Projects Before I Understood Why

Short summary

Next.js 16 renames middleware.ts to proxy.ts, shifting from general-purpose pipeline to network-boundary interceptor. proxy.ts now defaults to Node.js runtime with full crypto support, enabling standard JWT libraries without Edge runtime workarounds. Migration requires codemods plus manual verification that middleware.ts is deleted and headers are set on requests for downstream consumption.

  • proxy.ts replaces middleware.ts in Next.js 16, clarifying its role as network-boundary proxy not request pipeline
  • Now runs Node.js runtime by default with full crypto support instead of Edge runtime's limitations
  • Critical: manually verify middleware.ts is deleted post-codemod and headers are set on request objects, not responses

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more