Hello,
I’ve been deploying my website on Vercel for a long time, and all branches have always been picked up correctly whenever I pushed changes.
Recently, I added a vercel.json file to handle my cron jobs. However, after adding this file, branch changes are no longer being detected by Vercel, and I can’t deploy them (they don’t show up in the UI).
Interestingly, whenever I create a new branch without the vercel.json file, it is correctly detected and automatically deployed.
My vercel.json
{
"crons": [
{
"path": "/api/cron/some-route",
"schedule": "30 * * * *"
}
]
}
My /api/cron/some-route/route.ts
export async function GET(req: NextRequest) {
if (req.headers.get('Authorization') !== `Bearer ${process.env.CRON_SECRET}`) {
return NextResponse.json("Unauthorized", { status: 401 });
}
// some job
return NextResponse.json({ ok: true });
}
By the way, I can successfully access the route with a GET request.