koajs / koa-body

koa body parser middleware
MIT License
950 stars 130 forks source link

typescript compiler error TS2315: Type 'Middleware' is not generic. #134

Closed powpi2000 closed 5 years ago

powpi2000 commented 5 years ago

Problem/Feature Request Summary

koa-body run in npx(dev) ok, but compiler failure

Environment Information

  1. run tsc: (result: node_modules/koa-body/index.d.ts:155:63 - error TS2315: Type 'Middleware' is not generic.)

any on use koa-body in typescript compiler ok?

MarkHerhold commented 5 years ago

Can you please provide a sample project to reproduce this issue?

MarkHerhold commented 5 years ago

Closing until there is a response.

roginneil commented 5 years ago

I'm also getting the same error on the latest version of the package node_modules/koa-body/index.d.ts:166:63 - error TS2315: Type 'Middleware' is not generic.

166 declare function koaBody (options?: koaBody.IKoaBodyOptions): Koa.Middleware<{}, {}>;

reuwi commented 5 years ago

Came across the same error

reuwi commented 5 years ago

Found the reason: the version of @types/koa is too low, upgrading it to the newest solves the problem.