Next.js middleware fails to execute after Vercel CLI 50.28.0 build regression

We hit the same issue. Two changes fixed it immediately:

  1. Set runtime: "nodejs" in the middleware config (instead of Edge Runtime)

  2. Pin Node.js to 22.x via engines.node in package.json

No rollback needed, new deployments work fine with these changes.