next-multiparty
next-multiparty copied to clipboard
Got an TS error with the `withFileUpload` method
Hey I use your lib on my projects but I always have an error here.

Can you help me ?
Oh hey @MatteoGauthier, for some reason I didn't get the Notification. You probably figured out the error already, but it's because with withFileUpload function updates the type of NextApiRequest so req.file is typed. You will need to change the types in your handler. Change your handler to
function handler(req: FormNextApiRequest, res: NextApiResponse) {
// ... your code
}