Comments (2)
@gabrielOttopia can you include the snippet of code from encode
that stack traces?
Are you using the useNullAsOptional
flag introduced in #1017 ? Historically we've not supported null
, so unless you're using useNullAsOptional
that behavior is probably expected.
from ts-proto.
@stephenh I tried that flag and got this error:
`src/autogenerated/X/X_management.ts:241:96 - error TS2345: Argument of type '{ clientId?: { id?: string | undefined; } | null | undefined; stationId?: { id?: { id?: string | undefined; } | null | undefined; address?: { ipv4?: number | null | undefined; ipv6?: Uint8Array | null | undefined; } | null | undefined; } | null | undefined; }' is not assignable to parameter of type '{ clientId?: { id?: string | undefined; } | null | undefined; stationId?: { id?: { id?: string | undefined; } | null | undefined; address?: { ipv4?: number | null | undefined; ipv6?: Uint8Array | null | undefined; } | null | undefined; } | null | undefined; } & { ...; } & {}'.
Type '{ clientId?: { id?: string | undefined; } | null | undefined; stationId?: { id?: { id?: string | undefined; } | null | undefined; address?: { ipv4?: number | null | undefined; ipv6?: Uint8Array | null | undefined; } | null | undefined; } | null | undefined; }' is not assignable to type '{ clientId?: ({ id?: string | undefined; } & { id?: string | undefined; } & {}) | undefined; stationId?: ({ id?: { id?: string | undefined; } | null | undefined; address?: { ipv4?: number | null | undefined; ipv6?: Uint8Array | ... 1 more ... | undefined; } | null | undefined; } & { ...; } & {}) | undefined; }'.
Types of property 'clientId' are incompatible.
Type '{ id?: string | undefined; } | null | undefined' is not assignable to type '({ id?: string | undefined; } & { id?: string | undefined; } & {}) | undefined'.
Type 'null' is not assignable to type '({ id?: string | undefined; } & { id?: string | undefined; } & {}) | undefined'.
241 message.connectedClients = object.connectedClients?.map((e) => ConnectedClient.fromPartial(e)) || [];
`
` Type '{ id?: string | undefined; } | null | undefined' is not assignable to type '({ id?: string | undefined; } & { id?: string | undefined; } & {}) | undefined'.
Type 'null' is not assignable to type '({ id?: string | undefined; } & { id?: string | undefined; } & {}) | undefined'.ts(2345)
`
the error snipped i get probably wont be too helpful
from ts-proto.
Related Issues (20)
- Easier to use oneof=union generated code HOT 1
- Support default instances on singular/required fields HOT 6
- Option to include generated type registry in exports HOT 5
- Consider switching many types to interfaces HOT 2
- Incorrect message names in the generated code for repeated fields HOT 2
- `nestJs=true` and `useDate=true` interferes with `@google-cloud/firestore` HOT 1
- runing cmd 'protoc' in the bash script will miss some files HOT 2
- `nestJs=true` incorrect type generation for proto fields with numbers
- Adding Explicit Type Definitions to Factory Method Objects HOT 1
- Unclear documentation for a NestJS stream handling HOT 1
- grpc client receive date wrong with grpc server create by nestjs and type orm HOT 2
- Feature Request: add options to limit generating encode and decode methods to only specific message types HOT 2
- Bug in toJSON Function with `removeEnumPrefix=true` and `unrecognizedEnumValue=0` Option Combination HOT 2
- feat: Provide configuration via file HOT 2
- docs: make a table of all available arguments in readme HOT 5
- protoc-gen-ts_proto no longer points to the correct plugin location in version 2.0.0 HOT 7
- When properties of an object are empty, empty buffer is returned from encode() HOT 2
- v2.0.2 missing package.json HOT 3
- Protoc throwing "basic_string::_M_construct null not valid" when trying to generate types HOT 1
- Significant Performance Regression in ts-proto v2 Compared to v1 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-proto.