You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating a JS file for a proto file using the protoc-gen-grpc-web plugin, 64 bit integers are treated as the JavaScript number type. As numbers in JS are limited precision floating point, they can not support large 64 bit integers without precision loss. As such, it is not possible to send a number such as 9024037547368883040 over GRPC.
The generated output for the TypeScript bindings includes the following. Attempting to pass in the original number will give a Typescript error due to loss of precision.
getBar(): number;
setBar(value: number): foo;
If the type system is circumvented, such as by passing a string cast to any, the remote server appears to receive the wrong value due to improper loss of precision (9024037547368883200 instead of 9024037547368883040).
I haven't been able to find any workarounds to use to avoid this issue yet.