Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support alternate protobuf implementations #169

Open
dimo414 opened this issue Oct 31, 2023 · 1 comment
Open

Support alternate protobuf implementations #169

dimo414 opened this issue Oct 31, 2023 · 1 comment

Comments

@dimo414
Copy link

dimo414 commented Oct 31, 2023

I'm using protobuf.js with gRPC-web and running into a console stack trace when experimenting with this extension:

VM564:75 Uncaught TypeError: request.toObject is not a function
    at newCallback (<anonymous>:75:30)
    at Array.<anonymous> (index.js:66:1)
    at Lc (index.js:59:1)
    at qc.<anonymous> (index.js:57:1)
    at Jb (index.js:35:1)
    at O (index.js:34:1)
    at Ac (index.js:48:1)
    at push.679758.n.W (index.js:46:1)
    at push.679758.n.R (index.js:46:1)

protobuf.js does have a toObject() function but it's declared on the type rather than the message, i.e. request.$type.toObject() works.

It would be awesome if this extension a) handled failures more gracefully than raising a type exception and b) either automatically or via a config hook supported other deserialization operations. For example with protobuf-ts you'd want to call request.toJson().

@dimo414
Copy link
Author

dimo414 commented Nov 2, 2023

Apparently google-protobuf is actually going away entirely so alternative library support will become necessary at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant