-
Notifications
You must be signed in to change notification settings - Fork 72
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
ES3 protobuf - getRepeatedWrapperField & wrapRepeatedField_ #24
Comments
Further logging tells me that this happens because jspb.Message.getField returns undefined. Both the following conditions do not match
|
Hi @prk68, I seem to have a similar issue, but it occurs to me running in both Chrome and Firefox. I've been using protobuf with grpc-web for a while now, and it suddenly occured for a particular definition. Both errors point to the same line as you mentioned. I use parcel to generate the client code. // Chrome console
TypeError: Cannot read property 'length' of undefined
at Function.jspb.Message.wrapRepeatedField_ (google-protobuf.js:432)
at Function.jspb.Message.getRepeatedWrapperField (google-protobuf.js:432)
at proto.domain.Question.getAnswersList (domain_pb.js:4651)
... // Firefox console
TypeError: d is undefined
wrapRepeatedField_ google-protobuf.js:432
getRepeatedWrapperField google-protobuf.js:432
getAnswersList domain_pb.js:4651
... I tried to regenerate the javascript files using protoc 3.12.4 and 3.13.0 and grpc-web 1.2.0 and 1.2.1, but both give the same results. The strange thing is, that it seems that sometimes setting the repeated field as an empty array ( I'm pretty clueless in how to debug this further. Did you find a solution? |
Any news on this bug ? I have exactly the same as @jelleklaver, i can reproduce to give more informations if necessary. message FooResp {
repeated foo.Bar MyField = 1;
} (with |
Hi @Elojah, we came across this again this week and we just figured out what happened in our case. Our protobuf definitions rely on a shared Therefore, it was an issue on our side. I think a more readable error message like |
Same on my side, protobuf files were not generated for typescript |
This sounds like a versioning issue and we might have something we can upstream to help out in the future. |
I am trying to run protbuf serialization for JScript app that runs in a window scripting host runtime (WSH) on window. The JScript seems to based on a very old version of Ecmascript.
I webpacked my app code and ran into following error
"length is null or not an object"
for this line
for (var d = jspb.Message.getRepeatedField(a, c), e = [], f = 0; f < d.length; f++)
This seeems to be happening inside wrapRepeatedField_ function from a getRepeatedWrapperField call.
The same webpacked application code runs perfectly fine on chrome browser. So I am suspecting an issue either with missing polyfills because of which the message was not initialized properly.
I would appreciate any hints on how I could make this work on this old JScript runtime.
The text was updated successfully, but these errors were encountered: