ton-org / ton

Most popular TON Typescript Library
MIT License
143 stars 36 forks source link

TypeError: axios_1.default.post is not a function #56

Open saltykovdg opened 1 week ago

saltykovdg commented 1 week ago

Hi, I've connected the ton client import { TonClient } from '@ton/ton';, but I'm getting an error every time when I'm communicating with a contract, is it a known issue?

my dependencies:

  "dependencies": {
    "@orbs-network/ton-access": "^2.3.3",
    "@reduxjs/toolkit": "^1.9.7",
    "@ton/core": "^0.57.0",
    "@ton/crypto": "^3.3.0",
    "@ton/ton": "^15.0.0",
    "@tonconnect/protocol": "^2.2.6",
    "@tonconnect/sdk": "^3.0.5",
    "@tonconnect/ui-react": "^2.0.9",
    "@twa-dev/sdk": "^7.8.0",
    "buffer": "^6.0.3",

Error:

2HttpApi.js:263 Uncaught (in promise) TypeError: axios_1.default.post is not a function
    at HttpApi.doCall (HttpApi.js:263:1)
    at HttpApi.callGetMethod (HttpApi.js:235:1)
    at TonClient.runMethod (TonClient.js:40:1)
    at TonClient.callGetMethod (TonClient.js:55:1)
    at Object.get (TonClient.js:372:1)
    at Counter.getCounter (useCounterContract.ts:12:1)
    at Proxy.<anonymous> (openContract.js:38:1)
    at getValue (useCounterContract.ts:49:1)
    at useCounterContract.ts:53:1
    at commitHookEffectListMount (react-dom.development.js:23189:1)
saltykovdg commented 1 week ago

Workaround to fix an issue: add into package.json

"dependencies": {
   ...
   "axios": "^0.28.1",
   ...
 },
 "resolutions": {
   "axios": "^0.28.1"
 },