In the source code, we export ```typescript export type NextApiHandler<T = any> = ( req: NextApiRequest, res: NextApiResponse<T> ) => unknown | Promise<unknown> ``` But the validator expects ```typescript (req: any, res: any) => Promise<Response | void> | Response | void ``` This was a mistake on my part -- the first type is accurate and the second is not. Referenced by @WilliamIPark, @ecl1ps, @MadaShindeInai, @HimanshuKumarDutt094, and @soulchild in #82877 (tagging so you can follow this issue)
Activity
[-][pages] API route validation is too strict[/-][+][pages] incorrect API route validation[/+]fix: validation return types of pages API routes (#83069)
fix: validation return types of pages API routes (#83069)
fix: validation return types of pages API routes (vercel#83069)