Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got an TS error with the withFileUpload method #3

Open
MatteoGauthier opened this issue Oct 28, 2022 · 1 comment
Open

Got an TS error with the withFileUpload method #3

MatteoGauthier opened this issue Oct 28, 2022 · 1 comment

Comments

@MatteoGauthier
Copy link

Hey I use your lib on my projects but I always have an error here.

Capture d’écran 2022-10-28 à 13 38 59

Can you help me ?

@cstrnt
Copy link
Owner

cstrnt commented Jan 6, 2023

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants