Problem
My Next.js 14.2.35 middleware stopped executing on production. After extensive debugging, I traced it to a regression in Vercel CLI 50.28.0.
Evidence
I have two deployments of the exact same commit (d14ff83):
- Original build (
Vercel CLI50.27.1) → middleware works perfectly - Fresh rebuild (
Vercel CLI50.28.0) → middleware never executes
Both builds are identical — same Next.js version (14.2.35), same ƒ Middleware 49.8 kB in build output, same routes, same everything. The only difference is the Vercel CLI version.
Symptoms
- Middleware compiles successfully and appears in deployment summary under “Routing Middleware” with correct matcher
- But it never executes at runtime — no headers set, no logs, no side effects
- Middleware does NOT appear in the deployment Functions tab (no Edge function listed)
- Even a minimal 5-line middleware (just sets one header, zero dependencies) doesn’t execute
- Fails on both custom domains and
.vercel.appURL - Clean redeploy without build cache doesn’t help
- Tried
VERCEL_CLI_VERSION=50.27.1env var but the version isn’t available on the registry
Middleware location: src/middleware.ts (also tested at project root — same result)
Workaround
Promoting the old deployment built with CLI 50.27.1 restores functionality.
Environment
- Framework:
Next.js14.2.35(App Router) - Plan: Hobby
- Structure:
src/directory
Is this a known regression in CLI 50.28.0? Is there a way to pin the build CLI version to 50.27.1?