Skip to content

TypeError: Cannot redefine property: stack #259

@SuficioAC

Description

@SuficioAC

Running a simple gRPC call using the TS SDK which errors results in the following error:

/home/services/injective/node_modules/@injectivelabs/exceptions/dist/cjs/exception.js:68
        super.stack = stack;
                    ^

TypeError: Cannot redefine property: stack
    at GrpcUnaryRequestException.setStack (/home/services/injective/node_modules/@injectivelabs/exceptions/dist/cjs/exception.js:68:21)
    at GrpcUnaryRequestException.parseError (/home/services/injective/node_modules/@injectivelabs/exceptions/dist/cjs/exception.js:39:14)
    at new ConcreteException (/home/services/injective/node_modules/@injectivelabs/exceptions/dist/cjs/exception.js:30:14)
    at new GrpcUnaryRequestException (/home/services/injective/node_modules/@injectivelabs/exceptions/dist/cjs/exceptions/GrpcUnaryRequestException.js:8:9)
    at IndexerGrpcDerivativesApi.<anonymous> (/home/services/injective/node_modules/@injectivelabs/sdk-ts/dist/cjs/client/indexer/grpc/IndexerGrpcDerivativesApi.js:200:23)
    at Generator.throw (<anonymous>)
    at rejected (/home/services/injective/node_modules/@injectivelabs/sdk-ts/dist/cjs/client/indexer/grpc/IndexerGrpcDerivativesApi.js:6:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Occurs due to Error.stack not being overwritable.

Makes the TS SDK unusable without modifying the source.

Node v21.2.0

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