File Upload works fine in dev, but throws a 405 error in prod

I have a nextJs app, trying to upload files (end goal is to send the file as an attachment to an email address using nodemailer), it works fine in dev mode.

I have my environment variables set both in dev and the prod, is there any other config I need to setup in vercel to help handle file upload in prod?

Here’s a link to the way I handle the file upload: file upload route

You can’t write files to the file system on Vercel - you’d have to attach the raw contents of the file if the nodemailer API allows this or find a similar solution.

Additionally you mentioned getting a 405 error. Can you confirm whether this is from your own route (such as attempting to PUT instead of POSTing) or whether it’s an issue from a different call within your route handler?