`protobuf-js' is a Protocol Buffers encoder/decoder for Javascript.
Questions tagged [protobuf.js]
108 questions
1
vote
1 answer
Decoded Timestamp is not the same date as original DateTime value
We have a .NET application that defines a DateTime in the schema like so:
[ProtoMember(20)]public DateTime? Birthdate;
The application is able to serialize the data using protobuf-net and later upon deserialization the date is retrieved accurately…

Jordan H
- 52,571
- 37
- 201
- 351
1
vote
1 answer
ProtobufJS repeated bytes field not encoding Uint8Array properly
I have a protobuf message defined as:
message examplemessage
{
string field1 = 1;
string field2 = 2;
repeated bytes field3 = 3;
}
I load my protobuf with:
protobuf.load(path).then(root => {
// global for example
examplemessage =…

user9385381
- 252
- 3
- 10
1
vote
0 answers
Pass proto field which has value only
I have a service to pass input array of object to server using protobuf and successfully receive it on the server. The problem is I got the response according to the response definition. Here is the response
[ { uuid: '',
quantity: 3,
…

Muhaimin CS
- 195
- 2
- 19
1
vote
2 answers
protobuf.js: Is there a synchronous way of loading static code
I've trying to load synchronously protobuf.js static code (generated with pbjs).
According to the documentation, the documented method is asynchronous.
The asynchronous loading is done like that:
protobuf.load("bundle.json", function(err, root) {
…

Stefan Walter
- 94
- 10
0
votes
0 answers
Backport prototype setProperty checks to 6.x
Could you please have a look into https://github.com/protobufjs/protobuf.js/pull/1910 and help many people to ensure security of their apps without major (to 7.x) upgrade? Thanks in advance!
There are few people tagging maintainers in repo, though…
0
votes
0 answers
How to setup "Long" library for protobufjs as a NPM package
I'm building an Angular (Typescript) web application that uses Protobuf for communicating with other services. At first, we stored all .proto files in our project and used protobufjs to compile them into 2 files:
compiled.pb.js:
/*eslint-disable…

Lê Quang Bảo
- 2,670
- 2
- 27
- 40
0
votes
0 answers
ng build not copying folder to dist
I am using protobufjs-cli to generate a .js file from .proto files and then from the .js file I generate a .d.ts file, which is imported and used in various files in my project (using Angular 15).
When I run ng build my-project the folder containing…

Flack
- 5,727
- 14
- 69
- 104
0
votes
2 answers
Why is the Protobuf blob heavier than the JSON equivalent?
I'm trying to use protobuf to accelerate data transfers between my front and back.
As a POC, I tried to load a JSON file, turn it into a protobuf buffer, and save the result in a new file.
But it turns out that the new file is heavier than the JSON…

Zorzi
- 718
- 4
- 9
0
votes
1 answer
protobufjs encode a wrapper message which includes an inner field with type google.protobuf.Any
I am using protobufjs library in Nodejs to send a message to a kafka topic and read the message from a java consumer.
Following are the protobuf definition. The Inner message should be packed in the Wrapper message field.
message Wrapper {
…

dilan.sp
- 41
- 1
- 6
0
votes
1 answer
Import shared protobuf package into different protobuf packages
I'm designing some protobuf schemas for a project, what I want is to have independent packages, and a shared package. please see the example below.
// file: shared.proto
syntax = "proto3";
package package.shared;
message Address {
string line =…

Code_Crash
- 734
- 5
- 22
0
votes
1 answer
**Long** type in protobuf compiled js
I updated my protobufjs to version 7.1.0 then the Long type in it got different from my Long type and it said you should import it from protobufjs but after that the error still been.
The Long type in compiled protobuf refers to a class but imported…

N.SH
- 616
- 7
- 20
0
votes
1 answer
protobuf map value is object or array of object
I have
message {
message leadsEntity{
optional string name = 1;
}
optional string description = 1;
map entity = 2;
}
Now I can have 2 types of responses-
// 1st case
{
description : "this is…

Anuresh Verma
- 818
- 1
- 13
- 30
0
votes
2 answers
typescript proto files not generating
I am able to generate JS and golang protobuf files, but not typescript. I keep getting an error that reads.
protoc-gen-ts: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in…

Mike3355
- 11,305
- 24
- 96
- 184
0
votes
0 answers
How to convert protobuf response fetched by an API to json?
I am using IGDB API (of twitch), it has a way to get response using Protocol Buffers using gRPC technology.
It is done by adding ".pb" extension at the end of the fetch url written in JavaScript, i.e.
"https://api.igdb.com/v4/games.pb"
When I happen…

rahulpandharkar
- 1
- 1
0
votes
0 answers
Protocol buffer: protocol compiler generated code for javascript project
I am following this guide to generate my runtime pb library. In --js_out=library=myprotos_lib.js,binary:, I am not sure what binary mean.
The generated js file has comments saying the param/return type is !(string|Uint8Array) or !Uint8Array.
I guess…

zoey1771
- 79
- 5