-
Notifications
You must be signed in to change notification settings - Fork 646
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
[question] How to generate require('@grpc/grpc-js')
instead of require('grpc')
#931
Comments
Version 1.8.0 of |
Thank you, @murgatroid99. Is there an example somewhere I can check? I have found the proposal of this new feature, but not a single test or sample. |
No, there is not currently an example for this. |
@murgatroid99 I have a very similar usecase where I'm trying to statically generate pb files and TypeScript bindings, and simply replacing Is this possible currently? If no, is there a branch/PR I can follow or help with? |
I would really like to try this as well. I have added the Can anybody help ? Here is the full command :
Thanks ! |
@paambaati I'm not surprised some type definitions are missing from @ctrlshp I'm not sure what could be causing that error. The first thing to try would be removing the |
@murgatroid99 I did a quick scan and looks like Is there some additional step to get the codegen to pick it up? |
They have to be re-exported in |
@murgatroid99 Thanks for your reply. Still the same problem with the amended command :
Removing
It looks a little bit different than the one generated without
Here is the proto file just in case :
Is there anything that I am doing wrong ? I tried to remove the "node_modules" directory and redo a |
I think the problem is the filename. I can reproduce the problem with the given code, but it works fine if I rename the proto file to In the future when you encounter that kind of error it might help to include the full dump that comes with the "Plugin output is unparseable" error. That's a complete dump of the binary communication between the plugin and |
I renamed the file to "system2.proto" like you did. It doesn't work for me. Here is the full dump as per your request :
|
The other difference is that I ran the code on Linux, not Mac. Since I saw a failure I assumed it was the same one you were seeing. Otherwise it could be a problem specific to Mac. |
@murgatroid99 I started working on #931 (comment), but looks like the the types from For example, How do you propose I go about reconciling these differences? |
@murgatroid99 @paambaati has there been any progress on this? I modified I can try making a pull-request if there is still interest. |
@mpminardi Please do! AFAIK, PRs are being actively merged. |
@murgatroid99 I came across the same error as @ctrlshp in #931 (comment) in both macOS and Linux. The fix seems to be quite simple, I have added a PR #1225 |
Hi, Since I am passing by and seeing this issues, I managed to generate code that uses I still need to test if it works properly. |
I am going to close it. It is supported by Thank you for the help! 🙏 |
I am not sure if this is the correct place to ask...
I would like to use
@grpc/grpc-js
instead ofgrpc
in the generated JS code to overcome an issue inside a bundled electron application.Is it possible to staticly generate the JS code with
require('@grpc/grpc-js')
instead ofrequire('grpc')
. My current approach is to generate it withrequire('grpc')
, then parse the generated files and replace therequire
s in a manual step 😞 Is there a flag I can tweak to adjust the generator?I was unable to find the solution, so I set up a bare minimum example, perhaps someone can advise.
Thank you!
The text was updated successfully, but these errors were encountered: