Comments (11)
Quick fix: revert back protobufjs to ~6.6.5.
Looks like it is not compatible currently with 6.7.x, I will look at it later.
from rxjs-grpc.
Could you share your yarn lock file? Or if not used, the package json?
from rxjs-grpc.
yarn.lock
yarn.txt
from rxjs-grpc.
You can update rxjs-grpc to 0.1.2, it has set the correct protobufjs version.
from rxjs-grpc.
thank you, it works!
atom and vs code still show the error Property 'xyz' does not exist...
with Typescript 2.2.1 and 2.2.2
from rxjs-grpc.
It should work well in VS code, I am using it everyday. Can you share a bit more? At least the ts file and on which line you have the error.
from rxjs-grpc.
sample.proto
syntax = "proto3";
package sample;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {}
rpc SayMultiHello (MultiHelloRequest) returns (stream HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The request message containing the user's name and how many greetings they want.
message MultiHelloRequest {
string name = 1;
required uint32 num_greetings = 2;
}
// The response message containing the greetings.
message HelloReply {
string message = 1;
}
server.ts
import { Observable } from 'rxjs';
import { serverBuilder } from 'rxjs-grpc';
import { sample } from './grpc-namespaces';
async function main() {
type ServerBuilder = sample.ServerBuilder;
const server = serverBuilder<ServerBuilder>('sample.proto', 'sample');
server.addGreeter({
sayHello(request) {
return Observable.of({
message: 'Hello ' + request.name
});
},
sayMultiHello(request) {
return Observable.timer(100, 500)
.mapTo({ message: `Hello ${request.name}` })
.take(request.num_greetings);
}
});
server.start('0.0.0.0:50051');
}
main().catch(error => console.error(error));
client.ts
import { clientFactory } from 'rxjs-grpc';
import { sample } from './grpc-namespaces';
async function main() {
type ClientFactory = sample.ClientFactory;
const Services = clientFactory<ClientFactory>('sample.proto', 'sample');
const services = new Services('localhost:50051');
const greeter = services.getGreeter();
await greeter.sayMultiHello({ name: 'world', num_greetings: 3 }).forEach(response => {
console.log(`Multi greeting: ${response.message}`);
});
await greeter.sayHello({ name: 'world' }).forEach(response => {
console.log(`Greeting: ${response.message}`);
});
}
main().catch(error => console.error(error));
from rxjs-grpc.
from rxjs-grpc.
It looks like the grpc-namespaces is still the one generated with the old version.
from rxjs-grpc.
you are right! i recreated the namespace-file and now everythink looks good
from rxjs-grpc.
Released in v0.2.0.
from rxjs-grpc.
Related Issues (20)
- publish $protobuf import patch to npm HOT 1
- ServerBuilder/ClientBuilder for nested namespaces/packages HOT 1
- Output only contains "There are no input files to process." on OSX HOT 1
- Unable to run example with TypeScript 2.5.x HOT 3
- For service calls with streaming requests, the request should be a observable. HOT 1
- Support OS allocated random TCP port HOT 1
- Usage without RxJS? (Pure gRPC to TypeScript) HOT 4
- Enums are received as string, while the generated enum types them as number HOT 3
- Type 'ClientFactoryConstructor<{}>' cannot be converted to type 'ClientFactory'. Property 'getEmployeeRepo' is missing in type 'ClientFactoryConstructor<{}>'. HOT 2
- Type generation error
- Upgrade to RxJS 6 or add rxjs-compat dependency HOT 4
- Split generation and lib into two packages
- Create releases with proper release notes HOT 2
- Translate protobuf oneof attribute values into string literal types HOT 2
- Static generation HOT 2
- Is it no longer under maintenance? HOT 1
- Don't work in Angular HOT 1
- Unsubscribe Stream does not close connection
- Generated Enum Types Need to be Compiled
- support `protoc --proto_path=$GOPATH/src/whgo/product/proto` like go for import package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxjs-grpc.