protobuf.js version: 6.3.1
Here is my proto message:
message Response {
fixed32 id = 1;
bytes data = 2;
string error = 3;
}
When I directly decode the data sent from my server as a Uint8Array, for example:
let data = Uint8Array.from([26, 5, 69, 114, 114, 111, 114]);
let foo = Response.decode(data);
I get the following error:
TypeError: this.buf.utf8Slice is not a function
at BufferReader.read_string_buffer [as string]
at Function.decode
If I pass a Reader to the decode function, it works:
let data = Uint8Array.from([26, 5, 69, 114, 114, 111, 114]);
let foo = Response.decode(new Reader(data));
protobuf.js version: 6.3.1
Here is my proto message:
When I directly decode the data sent from my server as a
Uint8Array, for example:I get the following error:
If I pass a
Readerto thedecodefunction, it works: