Issue with c.req.formData() on Vercel
Hi I have a Hono API deployed on Vercel. I have a function that starts like this
For some reason when I send a request to this endpoint's function... it just hangs and times out on the
const formData = await c.req.formData()
line.
This line works just fine locally.. but when I deploy to Vercel.. it just hangs and eventually times out.
Anyone know what the issue could be?
15 Replies
Did this just to debug (see screenshot).. and the endpoint no longer times out.. something is up with the
await c.req.formData()
functionso the
authMiddleware
gets executed?Yes
and i assume that you've used logs to verify that the request is hanging at
await c.req.formData()
, not before or after
are you using app or page router? (i assume this is a backend for a next app)
also, can you share the implementation of authMiddleware
?Yes i've done something like this

I can see "1" being printed in my Vercel logs
I'm not using Next.js.. i'm just deploying a regular Hono app to Vercel
The issue I don't believe is with AuthMiddleware.. it works fine and other routes have no issue with it.
i get that. but maybe its doing something that would interfere with
c.req.formData
what's motivating your choice of vercel?
this is just a shot in the dark. doesn't really seem related, but could be worth a try: https://github.com/honojs/hono/issues/1256#issuecomment-1703549234
oooh. this seems like it might be the same as your issue though: https://github.com/vercel/next.js/issues/64002Hey @ambergristle I think I actually figured it out.. I believe it was Vercel's "Bot Protection" actually blocking the request.
I disabled Bot Protection and now it works 😛
glad you got it sorted!
I appreciate your time and assistance!
Also I like Vercel for it's reliability for the most part! Don't like having to fuss around with servers, etc 🙂
I know it's more expensive.. but.... idk 😄
have you had issues with other serverless providers?
I do like Cloudflare's Workers platform.. but the only thing that stopped me from using them was the worker size limit (10MB I believe?) I just didn't want to hit that limit as I scaled up my application
There was also the issue previously around NodeJS compatibility.. but i'm pretty sure it's much better now
gotcha. what about fly.io, digitalocean, koyeb, etc.?
Fly.io has had terrible reliability in the past when I tried them. Was stuck not being able to deploy updates for like 8 hours one day 💀 DigitalOcean/Hetzner are decent.. but again just don't really want to manage infra. The best platform i've prob seen is Railway.. really nice what they're building over there!
i see. that scans
thanks for sharing your perspective + experiences!