Registry / devops / grpc-getting-started

grpc-getting-started

JSON →
library0.4.3jsnpmunverified

A demonstration project for setting up gRPC with a front-end client using Envoy proxy, Node.js gRPC service, and webpack. Latest version 0.4.3 (last updated 2020). Shows how to compile .proto files, run Envoy, and build client bundles. Primarily a tutorial reference, not a production-ready library. Differentiators: combines gRPC web, Envoy proxy, and Node.js backend in one example.

npm install grpc-getting-started
INSTALL
IMPORT
SIG · GRPC-GETTING-START
G
grpc-getting-started
devopsjavascriptv0.4.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

greeting_pb
import { GreetingRequest, GreetingReply } from './greeting_pb'
require('greeting_pb')
Generated protobuf message classes are ESM only in this demo.
GreetingClient
const { GreetingClient } = require('./greeting_grpc_web_pb')
import { GreetingClient } from './greeting_grpc_web_pb.js'
The generated grpc-web client uses CommonJS in this project.
grpc
const grpc = require('grpc')
import grpc from 'grpc'
Node.js gRPC library uses require due to lack of named exports.

Shows minimal setup to run Envoy proxy and webpack dev server for gRPC demo.

npm run proxy & npm run start & # Open http://localhost:10005
Debug
Known issues
deprecatedPackage 'grpc' for Node.js is deprecated; use '@grpc/grpc-js' instead.
fix
Replace require('grpc') with require('@grpc/grpc-js') and update package.json.
affects: >=0.4.0
gotchaEnvoy proxy must be running for browser to communicate with gRPC backend.
fix
Run 'npm run proxy' before starting dev server.
affects: all
gotchaProto compilation step (npm run build:protos) required before client and API builds.
fix
Run 'npm run build:protos' at least once before other build commands.
affects: all
gotchagRPC-web client uses CommonJS require; mixing ESM imports may cause errors.
fix
Ensure client files are loaded via require() or bundled correctly with webpack.
affects: all
gotchaEnvironment ports (10005, 9090, 12345, 4002) may conflict with existing services.
fix
Modify ports in webpack.config.js, envoy.yaml, or server.js as needed.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'greeting_grpc_web_pb'
Missing generated gRPC-web client files.
fix
Run 'npm run build:protos' to regenerate client stubs.
Error: 14 UNAVAILABLE: Connection dropped
Envoy proxy not running or wrong backend address.
fix
Start Envoy with 'npm run proxy' and ensure backend server runs on port 9090.
ReferenceError: grpc is not defined
grpc module not imported in Node.js service.
fix
Add const grpc = require('grpc'); or update to '@grpc/grpc-js'.
Upgrade
Version history
0.4.3latest on npm
Audit
Dependencies
grpc-webrequiredRequired for browser gRPC client
envoyproxy/envoyoptionalEnvoy proxy to bridge gRPC-web and gRPC backend
Agent activity
10 hits · last 30 days
node
10
Resources
grpc-getting-started — npm install grpc-getting-started · libregistry