vkarpov15 / awaitjs-express

Write Express middleware and route handlers using async/await
Apache License 2.0
125 stars 13 forks source link

'useAsync' expects at least 2 arguments, but should be 1. #32

Open mrichhub opened 1 year ago

mrichhub commented 1 year ago

app.useAsync(async(req: Request): Promise<void> => { }) throws an error on version 0.9.0 with:

Expected at least 2 arguments, but got 1.

I believe this is just a typings issue because the definition for useAsync is trying to piggy back off of getAsync, postAsync, etc.

aphexcx commented 8 months ago

Also seeing this, curious if there's a workaround. For now I added // @ts-expect-error: TS2555 above the line.