Problem
Next.js App Router API route returns 404 in production even though the function exists in Vercel.
Environment
- Framework: Next.js (App Router)
- Platform: Vercel
- Branch:
main - Deployment Status: Ready (successful build)
API Route Configuration
Location: app/api/mt5/webhook/route.ts
export async function POST(req: Request) {
return Response.json({ success: true })
}
In Vercel → Deployment → Resources, I can see the function listed as /api/mt5/webhook, so Vercel detects it correctly.
Current Behavior
When I visit: https://vo-belly-swiss-warzone-4159.vercel.app/api/mt5/webhook
I get:
404: NOT_FOUND
Additional Details
- No logs appear for this route in Vercel Logs
- Other routes like
/dashboardwork correctly - Build command is default (Next.js preset)
- Root directory is empty (project root)
- Deployment status is Ready (Latest)
Questions
- Why would an App Router API route appear in Resources but still return
404? - Could there be a routing conflict between
app/apiandpages/api? - Could this be related to build output configuration?
- Is there something required in
route.tsbesides exportingPOST? - Could this be related to Edge vs Node runtime configuration?
I’ve double-checked everything and the deployment is marked as Ready.
Any help would be greatly appreciated.
Thank you.