Skip to content
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

TypeError: Cannot redefine property: stack #259

Open
SuficioAC opened this issue Nov 15, 2023 · 4 comments
Open

TypeError: Cannot redefine property: stack #259

SuficioAC opened this issue Nov 15, 2023 · 4 comments

Comments

@SuficioAC
Copy link

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

@zlace
Copy link

zlace commented Jan 16, 2024

Facing this issue as well.

@bangjelkoski
Copy link
Collaborator

How can I reproduce?

@zlace
Copy link

zlace commented Jan 16, 2024

Seems like it happens on node >20, resolved by fixing node version to 18.

One quick way to reproduce is trying to send some funds off an empty wallet (to trigger rpc error).

@SuficioAC
Copy link
Author

Yes, using a recent Node version, any error emitted by the library will cause this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants