typescript-language-server shows errors about missing properties on createPromiseClient()

This issue has been tracked since 2023-01-04.

Describe the bug

The TypeScript Language Server shows errors when calling createPromiseClient(). The generated service is not assignable.

Diagnostics:                                                                                                                                                                                                                                   
 1. Type 'PromiseClient<ServiceType>' is missing the following properties from type 'PromiseClient<{ readonly typeName: "workplus.account.v1alpha1.AccountService"; readonly methods: { readonly createAccount: { readonly name: "CreateAccount 
 "; readonly I: typeof CreateAccountRequest; readonly O: typeof CreateAccountResponse; readonly kind: any; }; readonly generateTemporaryPassword: { ...; }; readonly...': createAccount, generateTemporaryPassword, signIn                      
 2. Argument of type '{ readonly typeName: "workplus.account.v1alpha1.AccountService"; readonly methods: { readonly createAccount: { readonly name: "CreateAccount"; readonly I: typeof CreateAccountRequest; readonly O: typeof CreateAccountR 
 esponse; readonly kind: any; }; readonly generateTemporaryPassword: { ...; }; readonly signIn: { ......' is not assignable to parameter of type 'ServiceType'.

To Reproduce

import { AccountService } from "pb/workplus/account/v1alpha1/service_connectweb"
import {
  createPromiseClient,
  createConnectTransport
} from "@bufbuild/connect-web"

import type { PromiseClient } from '@bufbuild/connect-web'

interface API {
  account: PromiseClient<typeof AccountService>
}

const transport = createConnectTransport({
  baseUrl: "localhost:50100"
})

export const api: API = {
  account: createPromiseClient(AccountService, transport)
}

Environment (please complete the following information):

  • @bufbuild/connect-web version: 0.5.0
  • Framework and version: [email protected]
  • TypeScript: 4.9.4
0x1DA117 wrote this answer on 2023-01-04

It works now. It seems that I missed to install @bufbuild/protobuf.

More Details About Repo
Owner Name bufbuild
Repo Name connect-es
Full Name bufbuild/connect-es
Language TypeScript
Created Date 2022-02-16
Updated Date 2023-03-20
Star Count 851
Watcher Count 20
Fork Count 33
Issue Count 18

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date