-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Generated TypeScript message definition not compatible with message$Properties definition #826
Comments
I forgot to mention: I have the TypeScript compiler flag |
This is great. Any prediction as to when this will land in an npm release? |
It's on npm as 6.8.0 |
You're right, it is in 6.8.0. I was under the impression that 6.8.0 was final before I posted this issue. Terribly sorry about overlooking that! Thanks! |
No worries, you're welcome! :) |
The types are still incompatible, example:
It's because of the presence of |
@dcodeIO I think Alexendoo is right. The change you made doesn't solve the problem I posted, even though the types are now more accurate: the constructor for a given message can leave fields But yes, the presence of |
protobuf.js version: 6.7.3
Generated TypeScript message definition not compatible with message$Properties definition. It's not possible to (for example) pass a Token object as a parameter to Token.encode(token), since the types are incompatible.Protobuf version: 3
Protobuf definition
Generated Typescript definitions
Typescript error:
I'm pretty sure it should be possible to assign an object of Type
Token
to an object of typeToken$Properties
. This is however impossible, sincepublic message: (google.protobuf.Any$Properties|null);
is incompatible withmessage?: google.protobuf.Any$Properties;
. An optional field does not accept types which could be null.I believe this is the same issue as described here:
#808
The text was updated successfully, but these errors were encountered: