tatethurston / TwirpScript

A protobuf RPC framework for JavaScript and TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Map seems does not works properly

alexisvisco opened this issue · comments

Argument type (msg: MapMessage<CreateRequest.LenderPlans>) => Record<string, unknown> is not assignable to parameter type (value: {value: any, key: string}, index: number, array: {value: any, key: string}[]) => Record<string, unknown>

Argument type (number | LenderLoanPlan | undefined)[][] is not assignable to parameter type Iterable<readonly [PropertyKey, (number | undefined)]>

Argument type (msg: MapMessage<ComputeDatedLoanPlansResponse.LenderPlans>, json: any) => MapMessage<ComputeDatedLoanPlansResponse.LenderPlans> is not assignable to parameter type (value: {value: any, key: string}, index: number, array: {value: any, key: string}[]) => MapMessage<ComputeDatedLoanPlansResponse.LenderPlans>

@alexisvisco could you confirm which version of TwirpScript and TypeScript you're using?

I see "twirpscript": "^0.0.47" in your example and no yarn.lock. Do you still run into this issue on v0.0.50?

When I clone this repo, update twirpscript to v0.0.50 and run buf generate followed by tsc --noEmit the only errors I see are:

gen/ts/protos/leads/v1/leads.pb.ts:1106:15 - error TS2737: BigInt literals are not available when targeting lower than ES2020.

Updating compilerOptions.target to es2020 resolves these.

Update

Sorry I was on the main branch. You can ignore the above. Switching to your branch I can recreate this issue.