`protobuf-js' is a Protocol Buffers encoder/decoder for Javascript.
Questions tagged [protobuf.js]
108 questions
1
vote
1 answer
Kafka Protobuf Console Consumer Serialization Exception
I have a problem regarding the #protobuf #serialization which occurs in #nodejs and #apache #kafka run by #confluent platform all in one community.
I serialize the data with google protobuf or protobufjs and send it to kafka with kafkajs. However,…

Hossein Mayboudi
- 395
- 1
- 4
- 12
1
vote
0 answers
Representing variable JSON object data in a message
Using protobufjs,
I'm trying to define a message that would have a field holding a standard JSON object.
In my Typescript code, I use
import {Field, Type} from 'protobufjs/light';
@Type.d('MyType')
class MyType {
@Field.d(1,…

Akata
- 11
- 2
1
vote
1 answer
Encode and decode protocol buffer any type message
I have a proto file that looks like this.
syntax = "proto3";
import "google/protobuf/any.proto";
message User {
google.protobuf.Any user = 1;
}
And then I try to encode and decode the message back I lose the information that is with…

Shih-Min Lee
- 9,350
- 7
- 37
- 67
1
vote
1 answer
Possible to post to Apollo server with protobuf?
I am working on a project that currently uses protobuf to communicate from the client to the api. I would like to do a proof of concept showing communication via graphql, and am wondering if its possible to send protobuf to apollo server instead of…

Kelly Milligan
- 578
- 1
- 4
- 17
1
vote
1 answer
Automatically wrapping & unwrapping wrappers.proto types in protobuf.js
I have been using protobuf.js (command line tools) pbjs and pbts to generate my js and typescript classes for my defined .proto files. I get a json response from my backend API that I am looking to deserialize into the protobuf generated classes.…

Vik
- 11
- 3
1
vote
1 answer
Node.js protobuf includes
We are trying to implement a grpc service in Node.
We have a common.proto-file where we describe common messages, that we can reuse across different services.
Up until now, we have only implemented services in Go, and consumed them in either Go or…

lshas
- 1,691
- 1
- 19
- 39
1
vote
1 answer
npm run serve:ssr. ENOENT: no such file or directory, open 'google/protobuf/api.proto'
I'm trying to migrate an existing angular app to use Server Side Rendering through Angular Universal. npm build:ssr works without any problems, but when trying to serve:ssr, it errors when trying to find 'google/protobuf/api.proto' and the other…

Keith Kelleher
- 41
- 4
1
vote
1 answer
How to define a gRPC service that handles any call?
I'm trying do some reverse engineering trying to understand what services are called among several .proto files. My question is if it's possible to implement a service on the server that handles all the call made and gives me the information of…

Leonardo Teixeira
- 54
- 3
1
vote
1 answer
Unable to install probufJs with node v12.6
I'm trying to implement grpc web service in nodejs. While installing dependency protobufJs using npm i protobuff, I'm getting error: no matching function for call to ‘v8::Function::NewInstance() on node version 12.13.
I have tried changing node…

Akshay Barpute
- 73
- 12
1
vote
1 answer
Cant load protobuf message with protobuf.js
Im trying to use proto messages with protobuf.js, encode them and send them to a RabbitMQ message broker. I have the following sub-folders inside my project:
- model
- protos
- transactions.proto
- RabitMQ.js
- routes
-…

Omri Shneor
- 965
- 3
- 18
- 34
1
vote
0 answers
Generating type definitions from .protobuf file using ts-protoc-gen results with just raw interfaces definitions except jspb.Message prototypes
I am using protobuf library in order to generate code for data structures shared between platforms.
One of these platforms is nodejs, I use typescript on top of that. So besides protoc compiler…

Falcon
- 121
- 5
1
vote
0 answers
Decoding serialized data from protobuf in javascript
I try to decode protobuf message in javascript using protobuf.js, but get the error: Error: invalid wire type 4 at offset 3.
I have 'message.proto' structure like this:
package proto;
message Data {
repeated ObjRecord records = 1;
}
message…

evaleria
- 1,281
- 6
- 23
- 30
1
vote
0 answers
How to get the custom option value in protobuf of javascript version?
I used custom option for a static mapping purpose. Things are working fine in python, java, c++ code. But the custom option field is missing when generating js code.
What I did :
extend enumValueOption
{
string test = 50001;
}
enum myEnum{
…

Zhongya Wang
- 11
- 2
1
vote
1 answer
how to remove the unused genreated require when use protobuf anotations
package usegogo.api.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
import "gogoproto/gogo.proto";
option…

xren
- 1,381
- 5
- 14
- 29
1
vote
0 answers
Including Protobuf returns "exports" is read only
I am trying to include the following as protobuf/index.js
const protobuf = require('protobufjs')
const root = protobuf.Root.fromJSON(require('./protobuf_bundle.json'))
const Message = root.lookup('Message')
Message.MessageType =…

Ian
- 3,539
- 4
- 27
- 48