Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'xy' of type 'z' is not assignable to 'string' index type 'UntypedHandleCall'. for class properties #237

Open
jeengbe opened this issue Oct 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jeengbe
Copy link

jeengbe commented Oct 22, 2023

Implementations of services like:

export class GrpcAccountService extends UnimplementedAccountServiceService {
  constructor(private readonly service: AccountService) {
    //        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Property 'service' of type 'AccountService' is not assignable to 'string' index type 'UntypedHandleCall'.
    super();
  }
}

don't allow any class members other than [method: string]: grpc_1.UntypedHandleCall;.

I don't see a way around this other than patch-removing that signature, which leaves the issue here:

  server.addService(
    GrpcAccountService.definition,
    new GrpcAccountService(services.accountService)
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Argument of type 'GrpcAccountService' is not assignable to parameter of type 'UntypedServiceImplementation'.
  );

The best solution to this I've found is patching and as-any'ing it, however very inelegant.

@thesayyn thesayyn added the bug Something isn't working label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants