question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue running grpc-dynamic-gateway

See original GitHub issue

I am having some issues using grpc-dynamic-gateway, and I was hoping to get some ideas or help from you on getting things working (or tell me if I’m doing something wrong).

My own proto file is failing, but I tried to run it against the example/api.proto file in the repository, and I am getting the same service.children error, as ‘children’ on the service instance seems to be undefined.

C:\ grpc-dynamic-gateway-master>node example example/api.proto 5050 ./example/api.js
C:\grpc-dynamic-gateway-master\example\index.js:35
      **proto[p][t].service.children.forEach(c => {**
                                  ^
 
**TypeError: Cannot read property 'forEach' of undefined**
    at Object.keys.forEach.t (C:\Users\graham\Desktop\grpc-dynamic-gateway-master\grpc-dynamic-gateway-master\example\index.js:35:35)
    at Array.forEach (native)
    at Object.keys.forEach.p (C:\Users\graham\Desktop\grpc-dynamic-gateway-master\grpc-dynamic-gateway-master\example\index.js:32:25)
    at Array.forEach (native)
    at Object.<anonymous> (C:\Users\graham\Desktop\grpc-dynamic-gateway-master\grpc-dynamic-gateway-master\example\index.js:31:20)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

A few questions:

  1. Do you know why I would get an error like that?
  2. You have a an empty stubbed out annotations.proto file with your test.proto a. Why is it stubbed instead of the one from grpc-gateway? b. With the stub, the http options attribute wouldn’t parse it seems, or am I missing something?
  3. The install docs for grpc-dynamic-gateway says to do this: a. npm -g grpc-dynamic-gateway b. I presume it’s a typo and it should be npm install?

Thank you, Graham

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gwihlidalcommented, Nov 21, 2017

Sorry for taking so long to get back to this; grpc-dynamic-gateway seems to work now after your changes. Thank you!

0reactions
konsumercommented, Aug 10, 2017

Maybe try just running on the console something like this:

grpc-client run --host localhost:50051 -I ./proto helloworld.proto -m hellowor
ld.Greeter.SayHello -a '{"name": "World"}'

after you do npm i -g grpcnode to get grpc-client in your path.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An all-in-one guide to gRPC-Gateway - LogRocket Blog
gRPC -Gateway is a plugin that generates a reverse proxy server for gRPC services that convert Restful/JSON into gRPC and vice versa.
Read more >
How to Interact With and Debug a gRPC Server - Medium
Let's learn how to interact with and debug a gRPC server. An issue with gRPC and protobuf, if you are used to REST-like...
Read more >
gRPC Gateway - Earthly Blog
So today, I'm going to build a gRPC gateway that accepts HTTP requests and proxies it through to my gRPC service.
Read more >
Customizing your gateway | gRPC-Gateway - GitHub Pages
Routing Error handler ... To override the error behavior when *runtime.ServeMux was not able to serve the request due to routing issues, use...
Read more >
Configuring a gRPC Service - v3.1.x - Kong Docs
Issue the following request to create a gRPC route: curl -XPOST localhost:8001/services/grpc/routes \ --data protocols= ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found