Theo's Typesafe CultTTC
Theo's Typesafe Cult2y ago
19 replies
DINO

Uploadthing error "An error occured while parsing input/output" when I try to upload with Insomnia

Hello,

This is the error I get:
{
   "message": "An error occured while parsing input/output"
}

This is my fastify:
server.register(fastifyMultipart)

server.register(createRouteHandler, {
  router: uploadRouter
})

This is my Uploadthing:
import { createUploadthing, type FileRouter } from 'uploadthing/fastify'

const f = createUploadthing()

export const uploadRouter = {
  imageUploader: f({
    image: {
      maxFileSize: '4MB',
      maxFileCount: 4
    }
  }).onUploadComplete((data) => {
    console.log('upload completed', data)
  })
} satisfies FileRouter

export type OurFileRouter = typeof uploadRouter
image.png
Was this page helpful?