How do I make GRPC service calls in node
See original GitHub issueUsing improbable-eng/grpc-web 0.8.0
I’m trying to make a GRPC service call in a node environment (doing server side rendering), but I get an error when executing the request from this library. I saw that Node environments are supported and I have verified that my tsconfig has the dom
lib included.
When i make a request in node, i get this error: This environment's XHR implementation cannot support binary transfer.
It looks like the browser support checks (https://github.com/improbable-eng/grpc-web/blob/master/client/grpc-web/src/transports/http/xhr.ts#L13-L17) are assuming a browser environment.
Any tips on how to get this working in node?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Basics tutorial | Node - gRPC
Create a Server constructor from the RouteGuide service descriptor. Implement the service methods. Create an instance of the server by calling ...
Read more >gRPC service in Node.js: Tutorial, Examples and Best practices
gRPC is an open-source remote procedure call(RPC) framework created by Google. It is an inter-process communication technology based on HTTP/2, ...
Read more >Tutorial: How to Build Your First Node.js gRPC API - Trend Micro
To create a gRPC object, call the grpc-js method, loadPackageDefinition while passing in the previously created package definition. Use the ...
Read more >Tutorial on How to Implement gRPC Services in NodeJS
Initialize Node environment · Install gRPC server · Define the StudentService in proto · Create Client stub · getAll Method: Get all Students....
Read more >How to Create an API Using gRPC and Node.js
To create the server, open up the server.js file and load up the gRPC dependencies and the .proto file created earlier: //dependencies const ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you need to set the transport to
NodeHttpTransport
, why is that line commented out?When instantiating the
Service.RequestClient
, you can pass in an options object to configure the transport of the GRPC service.this is how my code looks:
Use this transport: https://www.npmjs.com/package/@improbable-eng/grpc-web-node-http-transport