blakeembrey / blakeembrey/compose-middleware
Type 'Next<void>' is not assignable to type 'NextFunction'
Open
- Dominant language
- TypeScript
- Stars
- 90
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
I am using Typescript v4.0.2 and I am getting a type error when trying to use third party middleware that uses the NextFunction type from @types/express.
Culprit code:
```typescript
// Next & NextFunction are not compatable and no way to overwrite with generic
type Next = (err?: Error | null) => T;
type RequestHandler = (req: T, res: U, next: Next) => V;
```
I recommend something like:
```typescript
type RequestHandler = (req: TRequest, res: TResponse, next: TNext) => TReturn;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.