#No overload matches this call.

8 messages · Page 1 of 1 (latest)

plush hemlock
#

How do I solve this issue? I tried to import and use explicit types for request and response but it didn’t work.
Would really appreciate help and an explanation to this problem as well as a solution.

small mirage
#

@plush hemlock "No overloads match this call" means there's multiple potential signatures for the function and the arguments you're proving don't match any of them.

#

TS can't tell which signature you're trying to match so it can't give a very helpful error message.

#

So it just tells you about the last one (which is often the most 'general' one), but in this case it's the app.post(route, subApp) which is definitely not the one you're trying to match

#

Hard to say exactly what the error based on a screenshot. Might be an issue with using an async function - might be an issue with the version of express you're using

#

The basic version works on the playground, which uses latest express

restive mangoBOT
#
retsam19#0

Preview:```ts
import express from "express"

const app = express()
app.post("/foo", async (req, res) => {
return "foo"
})```

plush hemlock
# restive mango

I added Promise <any> and it worked, hope it doesn’t do any problems later on