hoangvvo / next-connect

The TypeScript-ready, minimal router and middleware layer for Next.js, Micro, Vercel, or Node.js http/http2
https://www.npmjs.com/package/next-connect
MIT License
1.62k stars 65 forks source link

types are incorrect on cloned router #222

Closed mattpodolak closed 1 year ago

mattpodolak commented 1 year ago

In this example: const router = baseRouter.clone();

baseRouter type is NodeRouter<NextApiRequest, NextApiResponse<any>>

I would expect router to be the same type, instead it is: NodeRouter<IncomingMessage, ServerResponse<IncomingMessage>>

hoangvvo commented 1 year ago

Fixed in https://github.com/hoangvvo/next-connect/commit/da2a5b19b471a8ff893825c6f7e03fba26617ed8