trpc-openapi icon indicating copy to clipboard operation
trpc-openapi copied to clipboard

Types errors

Open nkouuu opened this issue 2 years ago • 3 comments

When compiling I'm getting type errors on the MiddlewareResult union type. I was also getting type errors from the adapters, I guess because all of them are exported in index? but "skipLibCheck" solved that.

I've only imported OpenApiMeta.

import { OpenApiMeta } from "trpc-openapi";

Error

node_modules/@trpc/server/src/core/internals/procedureBuilder.ts:404:20 - error TS2339: Property 'error' does not exist on type 'MiddlewareResult<any>'.
  Property 'error' does not exist on type 'MiddlewareOKResult<any>'.

404       throw result.error;
                       ~~~~~

node_modules/@trpc/server/src/deprecated/internals/procedure.ts:244:20 - error TS2339: Property 'error' does not exist on type 'MiddlewareResult<any>'.
  Property 'error' does not exist on type 'MiddlewareOKResult<any>'.

244       throw result.error;

nkouuu avatar Jun 06 '23 15:06 nkouuu

Revert back to the old version (1.1.2) , the latest one introduces dependencies and one of them (not sure which) breaks something.

abanchev avatar Jun 07 '23 07:06 abanchev

Also happened with me

yangricardo avatar Jun 24 '23 00:06 yangricardo

also happen with me and take much time to figure out 😅😅

AdarshHatkar avatar Jul 07 '23 18:07 AdarshHatkar