ERROR:
responseClone.body?.getReader is not a function
TypeError: responseClone.body?.getReader is not a function
at parseGraphqlResponse (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:6339:40)
at Provider.fetchAndProcessBlockHeight (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:6511:36)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async FuelGraphqlSubscriber.create (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:2248:22)
at async _Provider.sendTransaction (file:///home/ubuntu/Apps/custodian_backend/node_modules/@fuel-ts/account/dist/index.mjs:6931:26)
This would seem to suggest that the response from the server doesn’t have a body, however, this should retry on failure and fail gracefully. I will add an issue for that now.
I am sharing the RPC URL: https://mainnet.fuel.network/v1/graphql. We are facing this issue in production. I have tried most of the troubleshooting steps. Please help me resolve this issue.
I’ve been struggle to replicate this. A potential fix for now would be to disable the RPC consistency mechanism. Could you try the following and let me know how you get on?
I’ve pushed through a PR to detect and throw an error with additional information about what potentially is going wrong. I did a lot of testing to try and replicate this, and was unsuccessful in my attempts.
My only thought would be that something on your server is blocking the connection for the subscription - have you tried running this on your local machine?
I haven’t tried this locally, but I ran the same commands in the Node console, and the transaction worked properly. However, I’m encountering the issue when using the API.
I’m using Node.js version 20.18.1. Initially, my TypeScript SDK version was 0.73. Due to the older SDK version, we faced the issue mentioned below. That’s why we upgraded to the latest version, 0.101.0. If there is a solution available for the older version, we are open to downgrading.
Error Message:
The Fuel Node you’re trying to connect to is using fuel-core version 0.43.2, which is not supported by the TypeScript SDK version you are using.
This does sound like an issue with the server connectivity, rather than with the TS SDK itself. It’d be worthwhile checking the logs on the server to check whether your system is denying the connection between the server and the node.
This error message is just a warning/disclaimer that things may not work as expected, not that they will. Please feel free to downgrade if it unblocks you for this time.
Hello @p.s
I tried downgrading my Fuel version to ^0.93.0. Now, I’m getting this error in the node modules and sharing the response I received from the node modules, which does not contain getReader().
TypeError: response.body.getReader is not a function
at _FuelGraphqlSubscriber.setStream (file:///home/ubuntu/Apps/custodian_backend/node_modules/fuels/node_modules/@fuel-ts/account/dist/index.mjs:1086:33)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _FuelGraphqlSubscriber.next (file:///home/ubuntu/Apps/custodian_backend/node_modules/fuels/node_modules/@fuel-ts/account/dist/index.mjs:1092:7)
at async TransactionResponse.fetch (file:///home/ubuntu/Apps/custodian_backend/node_modules/fuels/node_modules/@fuel-ts/account/dist/index.mjs:3675:39)
at async TransactionResponse.create (file:///home/ubuntu/Apps/custodian_backend/node_modules/fuels/node_modules/@fuel-ts/account/dist/index.mjs:3659:5)
at async Fuel.executeTransaction
My code is still working properly in the Node console. It has been running for more than 6 months without issues, but suddenly we are facing this problem.