Currently, I am in the process of converting an existing Node.js + express application from plain JS to TypeScript. Although I understand why I am encountering this error, I am unsure about the correct approach to resolve it. The type "Request" is coming from @types/express. Should I extend this type to include a property named product inside the body? My goal is to utilize the predefined types provided by @types/express wherever possible.
app.post('/something', function(req: Request) {
if (req.body) product = req.body.product
^^^^^^^^
})
Error from Typescript server: Property 'product' does not exist on type 'ReadableStream'. (tsserver 2339)