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

grpc-js dependency #306

Closed
jsbrain opened this issue May 28, 2021 · 2 comments · Fixed by #307
Closed

grpc-js dependency #306

jsbrain opened this issue May 28, 2021 · 2 comments · Fixed by #307
Labels

Comments

@jsbrain
Copy link
Contributor

jsbrain commented May 28, 2021

So for me generating the types with --ts_proto_opt=outputServices=grpc-js apparently changes the output stubs, but still imports e.g. the Metadata etc. dependencies from grpc but shouldn't it include them from @grpc/grpc-js instead?

So I expect

import { Metadata } from '@grpc/grpc-js';

but I got

import { Metadata } from 'grpc';

so I guess that's probably a bug?

@jsbrain
Copy link
Contributor Author

jsbrain commented May 28, 2021

Ok I just realized that there are already tests for it and it works when just using that option but I'm actually using it like this

protoc --plugin=../node_modules/.bin/protoc-gen-ts_proto \
  --ts_proto_opt=nestJs=true,esModuleInterop=true \
  --ts_proto_opt=addGrpcMetadata=true \
  --ts_proto_opt=outputServices=grpc-js \
  --ts_proto_out=. "${proto_files[@]}"

after after a quick test I realized it doesn't work in combination with --ts_proto_opt=nestJs=true which might was intentional but actually NestJS will switch to grpc-js in v8 so those options should probably work together in the future 🥳

@stephenh
Copy link
Owner

🎉 This issue has been resolved in version 1.82.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants