Skip to content

Allow configuration to choose BigInt over Long.js for int64 types #3047

Open

Description

@Will-Mann-16

Is your feature request related to a problem? Please describe.

Inability to configure parsing int64 types to BigInt over Long.js or String - .

Describe the solution you'd like

At the moment the choices for when we can handle int64/uint64 types are only Long or String - Now with the ES2020 inclusion of BigInt which is much more compatible and doesn't rely on a third party package. We're also using ts-proto to codegen values and they give us the option but unfortunately it's not available on this library AFAIK.

Describe alternatives you've considered

We can use strings or Long.js but for us it makes much more sense in our use case to maintain using the Number type and using the BigInt option for us as it's much more futureproof.

Additional context

We're using Nest.js here with these package versions:

@nestjs/microservices: ^11.1.17
@grpc/grpc-js: ^1.14.3
@grpc/proto-loader: ^0.8.0
@nestjs/common: ^11.0.1
@nestjs/core: ^11.0.1

Activity

  1. murgatroid99 commented on Apr 14, 2026

    @murgatroid99
    Member

    The @grpc/proto-loader library is a fairly thin wrapper around the protobufjs library, and that's what controls this behavior. Unfortunately, the PR to add that functionality there (protobufjs/protobuf.js#1908) has been open for 3 years without any response.

  2. dcodeIO commented on May 22, 2026

    @dcodeIO

    On the protobuf.js side, this is partly covered by protobufjs/protobuf.js#2257 (feat: Support BigInt conversions) and also backported to 7.x: fromObject can accept BigInt input, and toObject supports { longs: BigInt }. To maintain compatibility, this does not switch the runtime representation itself to BigInt yet. Changing the internal representation is left for protobuf.js 9.x.

  3. brzosthub commented on Aug 11, 2026

    @brzosthub

    Hey team. I've created mr to fix that: FIX

  4. added a commit that references this issue on Sep 22, 2026
    e4be8ce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions