- Symptom
- No runtime log for the cron path at the scheduled timeHitting the path in a browser works because the browser follows the redirectMiddleware that redirects unauthenticated requests to /login also catches the cron call
- Cause
- Vercel calls the production deployment with a plain GET and treats any 3xx as the final answer, and redirected or cached cron responses are hidden from the logs. Trailing slash rewrites, auth middleware, or locale redirects on the cron path make the job silently finish without running.
- Fix
- Exclude the cron path from middleware redirects, use the exact path the router serves, and authenticate the call with the CRON_SECRET bearer header instead of a session check.
- Apply
// middleware.ts export const config = { matcher: ['/((?!api/cron).*)'] }; // app/api/cron/route.ts export function GET(req: Request) { if (req.headers.get('authorization') !== `Bearer ${process.env.CRON_SECRET}`) return new Response('Unauthorized', { status: 401 }); return Response.json({ ok: true }); }- Affected
- Vercel Cron Jobs on all plans, production deployments only, as of October 2026
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders