You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To try the sample app, we need a gRPC server running locally. Let’s compile and run, for example, the Node.js server in this repository:
$ cd ../../node
$ npm install
nmp install errors:
$ npm install
npm ERR! Cannot use 'in' operator to search for 'bundleDependencies' in These examples have been moved to https://github.com/grpc/grpc-node/tree/master/examples
This is because the package.json is just a string:
$ cat package.json
"These examples have been moved to https://github.com/grpc/grpc-node/tree/master/examples"
I'd suggest simply linking to https://github.com/grpc/grpc-node/tree/master/examples/routeguide but there are no instructions there for running the route guide example. So perhaps it would be better to give people specific instructions to run the node server inside the php examples directory:
$ git clone https://github.com/grpc/grpc-node.git
$ cd grpc-node/
$ npm install
$ cd dynamic_codegen/
$ node ./route_guide_server.js --db_path=route_guide_db.json
Note that the current instructions have the node command incorrectly written as nodejs:
Running RecordRoute...
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in grpc/examples/php/route_guide/route_guide_client.php:115
Stack trace:
#0 grpc/examples/php/route_guide/route_guide_client.php(203): runRecordRoute()
#1 grpc/examples/php/route_guide/route_guide_client.php(212): main()
#2 {main}
thrown in grpc/examples/php/route_guide/route_guide_client.php on line 115
This is because:
$ cat ../../node/static_codegen/route_guide/route_guide_db.json
"These examples have been moved to https://github.com/grpc/grpc-node/tree/master/examples"
Pointing run_route_guide_client.sh to ./grpc-node/examples/routeguide/static_codegen/route_guide_db.json fixes the issue.
Fix
I'd be happy to make a PR to fix these instructions if there's agreement that cloning grpc-node into the examples/php/route_guide directory makes sense.
The text was updated successfully, but these errors were encountered:
Thanks for logging this issue. Yea the php example is outdated.
On the suggestion, I think we should just link to the grpc/grpc-node repo instead of copying any code. (i.e. update the instruction to say "use grpc/grpc-node in this way")
I think we should just link to the grpc/grpc-node repo instead of copying any code. (i.e. update the instruction to say "use grpc/grpc-node in this way")
Yeah, this sounds better. I'll make a PR for these changes next week to get the ball rolling!
There are multiple issues with https://grpc.io/docs/languages/php/basics/.
Instructions to build
grpc_php_plugin
appear to be outdated.This section produces an error:
The script errors:
Instead, the instructions should say to use bazel as in grpc/grpc#25350 (comment):
The node server has moved
This section produces an error:
nmp install
errors:This is because the package.json is just a string:
I'd suggest simply linking to https://github.com/grpc/grpc-node/tree/master/examples/routeguide but there are no instructions there for running the route guide example. So perhaps it would be better to give people specific instructions to run the node server inside the php examples directory:
Note that the current instructions have the
node
command incorrectly written asnodejs
:Client script fails
eventually hits this error:
This is because:
Pointing
run_route_guide_client.sh
to./grpc-node/examples/routeguide/static_codegen/route_guide_db.json
fixes the issue.Fix
I'd be happy to make a PR to fix these instructions if there's agreement that cloning
grpc-node
into theexamples/php/route_guide
directory makes sense.The text was updated successfully, but these errors were encountered: