multiversx / mx-sdk-js-network-providers

Network Provider (API, Gateway) components (compatible with sdk-js).
Other
6 stars 6 forks source link

Using version 2.2.0 results in an error when querying SCs #52

Open damienen opened 6 months ago

damienen commented 6 months ago

Seems like because of the update of axios to a new version, the tests (internal tests from the library) that use jest return an error when being used in a project:

TypeError: axios_1.default.post is not a function

A related post: https://github.com/facebook/create-react-app/discussions/12823

andreibancioiu commented 6 months ago

Thank you :pray:

Also reproduced here: https://t.me/MultiversXDevelopers/121486

andreibancioiu commented 6 months ago

Issue manifests when a newer @multiversx/sdk-network-providers is used in conjunction with older versions of@multiversx/sdk-dapp, which referenced an older axios (before v1).

Normally, the issue should be resolved by:

Further testing is necessary to confirm the fix, though.

andreibancioiu commented 6 months ago

Update: https://github.com/multiversx/mx-sdk-dapp/pull/992 should normally fix this.

CiprianDraghici commented 6 months ago

@damienen could you check sdk-dapp@2.25.2? Let me know if your error still persists.

cc @andreibancioiu

damienen commented 6 months ago

Yes, I can confirm error persists when using these packages: "@multiversx/sdk-core": "12.17.0", "@multiversx/sdk-dapp": "2.25.2", "@multiversx/sdk-native-auth-client": "1.0.6", "@multiversx/sdk-network-providers": "2.2.0",

andreibancioiu commented 6 months ago

Additional step to fix this is attempted here: https://github.com/multiversx/mx-sdk-js-network-providers/pull/53.

andreibancioiu commented 5 months ago

Also reported here: https://t.me/MultiversXDevelopers/122488

andreibancioiu commented 5 months ago

Possibly related to: https://stackoverflow.com/questions/76888080/react-app-throwing-axios-1-default-post-is-not-a-function-error

icegriffinguru commented 5 months ago

Possibly related to: https://stackoverflow.com/questions/76888080/react-app-throwing-axios-1-default-post-is-not-a-function-error

This resolved the issue. :pray:

andreibancioiu commented 5 months ago

Related: https://github.com/multiversx/mx-sdk-dapp/issues/999.