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
I have been encountering a problem lately where if I have a repeated field - and the given message does not populate any values in the repeated field - calling the getter for that field on that message will error:
The error looks like:
TypeError: Cannot assign to read only property '3' of object '[object Array]'
I am using a python backend to generate the messages.
For example, it would occur with protos:
message Bar {}
message Foo {
repeated Bar bars = 1;
}
the message created as Foo(bars=[]) in python
then this:
foo.getBarsList()
would raise the TypeError - but if the message had happened to be created as Foo(bars=[Bar()]), then no error would occur.
I am running grpc-web 1.4.2, grpcio = "^1.56.0" in python, and protoc 3.20.1
I do not expect that empty repeated messages are generally broken as this would certainly have been raised as an issue if it was true - but I'm looking for potential causes, debugging steps I should execute, and creating this issue for anyone else that might run into this.
Thanks
The text was updated successfully, but these errors were encountered:
I wonder if you can, help identify the exact line of code which throws that error?
It would be helpful if you can try not further obfuscate the JS bundle using something like "development" mode (like by replacing this line).
It's ok if the line is already obfuscated, but at least we can confirm where the error is coming from.
I'd guess it's happening in the protobuf-javascript library, since from what i can tell from my manual test, the generated code would simply call into the getRepeatedWrapperField function, like below:
I have been encountering a problem lately where if I have a repeated field - and the given message does not populate any values in the repeated field - calling the getter for that field on that message will error:
The error looks like:
I am using a python backend to generate the messages.
For example, it would occur with protos:
the message created as
Foo(bars=[])
in pythonthen this:
would raise the
TypeError
- but if the message had happened to be created asFoo(bars=[Bar()])
, then no error would occur.I am running
grpc-web 1.4.2
,grpcio = "^1.56.0"
in python, and protoc3.20.1
I do not expect that empty repeated messages are generally broken as this would certainly have been raised as an issue if it was true - but I'm looking for potential causes, debugging steps I should execute, and creating this issue for anyone else that might run into this.
Thanks
The text was updated successfully, but these errors were encountered: