HonoH
Hono6mo ago
Dmitry

Issue with c.req.formData() on Vercel

Hi I have a Hono API deployed on Vercel. I have a function that starts like this
// Pusher auth route
const pusherAuth = factory.createHandlers(authMiddleware, async (c) => {
  // Get socket_id and channel_name from the request
  const formData = await c.req.formData()
  const socketId = formData.get('socket_id')?.toString()
  const channelName = formData.get('channel_name')?.toString()

  if (!socketId || !channelName) {
    return c.json({ message: 'Invalid params' }, 400)
  }

  const user = c.get('user')

  // ... (More code below)

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?
image.png
Was this page helpful?