Skip to content

TypeError: Object is not a function issue when Object message exists in proto file #579

@larscliff

Description

@larscliff

Hello everyone, and thank you for this library!

I have encountered an issue with a proto file that includes an "Object" message (yes, I know that is not a good name for the message, but it is what it is). For the sake of simplicity, it looks like this:

syntax = "proto3";

message Object {
     string object_id = 1;
}   

message ObjectList {
    repeated Object object = 1;
}

message RequestMessage {
}

service TestService {
    rpc Get(RequestMessage) returns (Object);
    rpc GetAll(RequestMessage) returns (ObjectList);
}

When I run my React app which is build with CRA I got this error:
image

Any ideas how to resolve the issue? Except message renaming :)
I did not have this problem using protoc-gen-grpc-web protoc plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions