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):
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 |
Issue Title | Created Date | Updated Date |
---|