Skip to content

Support alternate protobuf implementations #169

Description

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions