We have the exact same code in two API routes one being named app/api/demo/route.ts and the other being named app/api/sendgrid/route.ts. When we run them locally they both work, but on deployment the demo one returns a 404 where as the sendgrid one works as expected. And we made sure we're calling the correct routes (example.com/api/demo)
We're using Next.JS 14 app router