GithubHelp home page GithubHelp logo

Comments (2)

stephenh avatar stephenh commented on June 15, 2024

@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.

gabrielOttopia avatar gabrielOttopia commented on June 15, 2024

@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

image

from ts-proto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.