-
Notifications
You must be signed in to change notification settings - Fork 71
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
ServiceType in "@bufbuild/protobuf": "^2.0.0", Conflict Error #959
Comments
Hey @junmingchen123, Connect-ES does not support Protobuf-ES version 2 yet. We will update it shortly. If you want to give it a try before we cut a stable release, you can use the alpha version:
|
Thanks for your reply, but ServiceType is still not available in @bufbuild/protobuf@latest, which is now 2.0.0, and I will replace |
confirm this issue on
replace please update docs and correct it |
Ah, we missed to update this example, thanks for the shout. Updating the docs here: connectrpc/connectrpc.com#227 Related update to MIGRATING.md: connectrpc/connect-es#1343 |
`// use-client.ts
import { useMemo } from "react";
import { ServiceType } from "@bufbuild/protobuf";
import { createConnectTransport } from "@connectrpc/connect-web";
import { createPromiseClient, PromiseClient } from "@connectrpc/connect";
// This transport is going to be used throughout the app
const transport = createConnectTransport({
baseUrl: "https://demo.connectrpc.com",
});
/**
*/
export function useClient(service: T): PromiseClient {
// We memoize the client, so that we only create one instance per service.
return useMemo(() => createPromiseClient(service, transport), [service]);
}`
Dear author, I hope you can tell me what to do. Now there is a conflict. Sorry to bother you. The above is the ServiceType used in the official sample code, but when I use version 2.0.0, there is no ServiceType. However, even if I want to lower the version, in the generated api code, there is @bufbuild/protobuf/codegenv1 in the import. If you do not use version 2.0.0 or above, codegenv1 will not have this, and this will report an error. Now, when I use 2.0.0, there is no error. When I try to use the interface, an error is reported again.
This is Error
`✘ [ERROR] No matching export in "node_modules/@bufbuild/protobuf/dist/esm/index.js" for import "protoBase64"
✘ [ERROR] No matching export in "node_modules/@bufbuild/protobuf/dist/esm/index.js" for import "Message"
✘ [ERROR] No matching export in "node_modules/@bufbuild/protobuf/dist/esm/index.js" for import "MethodIdempotency"
✘ [ERROR] No matching export in "node_modules/@bufbuild/protobuf/dist/esm/index.js" for import "MethodKind"
✘ [ERROR] No matching export in "node_modules/@bufbuild/protobuf/dist/esm/index.js" for import "protoBase64"
This is pachakge.json
"@bufbuild/connect": "^0.13.0", "@bufbuild/protobuf": "^2.0.0", "@connectrpc/connect": "^1.4.0", "@connectrpc/connect-web": "^1.4.0",
The text was updated successfully, but these errors were encountered: