cosmology-tech / cosmos-kit

Universal wallet connector for the Cosmos ⚛️
https://cosmology.zone/products/cosmos-kit
BSD 3-Clause Clear License
183 stars 132 forks source link

getOfflineSigner - Cannot read properties of undefined (reading 'client') #144

Closed srph closed 1 year ago

srph commented 1 year ago

Hi, it seems that calling offlineSigner results to an error:

_app-3bf4a8d17e54b3b5.js:359 TypeError: Cannot read properties of undefined (reading 'client')
    at getOfflineSigner (_app-3bf4a8d17e54b3b5.js:352:1768141)
    at r (_app-3bf4a8d17e54b3b5.js:347:173988)
    at Object.getOfflineSigner (_app-3bf4a8d17e54b3b5.js:347:174777)
    at index-2158354431a91ef2.js:1:24801
    at j (main-1f17483a0f830ef3.js:1:92781)
    at Generator._invoke (main-1f17483a0f830ef3.js:1:94067)
    at a.<computed> [as next] (main-1f17483a0f830ef3.js:1:93184)
    at d (677-a6b8e863b5453eed.js:1:501560)
    at h (677-a6b8e863b5453eed.js:1:501757)

Reproduction here. Demo here

Just happened to stumble upon this issue while playing with another chain.

ghost commented 1 year ago

@pyramation I'm also running into this with any network I use in useChain.

    "@cosmos-kit/core": "1.0.4",
    "@cosmos-kit/keplr": "0.32.21",
    "@cosmos-kit/react": "1.0.4",
kombos commented 1 year ago

could you please let us know in which version has this fix been implemented? I had tried this today and it was still throwing the same error.

npm packages that i'm using: "@cosmos-kit/core": "^1.0.4", "@cosmos-kit/cosmostation": "^0.14.21", "@cosmos-kit/keplr": "^0.32.21", "@cosmos-kit/leap": "^0.13.21", "@cosmos-kit/react": "^1.0.4",

Error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'client') at getOfflineSigner (client.js?e347:21:1) at clientMethodAssert (hooks.js?2a7b:110:1) at getOfflineSigner (hooks.js?2a7b:147:1) at eval (GravityToEthBridge.js?a307:181:26) at step (tslib.es6.js?a65a:102:1) at Object.eval [as next] (tslib.es6.js?a65a:83:46) at asyncGeneratorStep (_async_to_generator.mjs?4e1b:3:1) at _next (_async_to_generator.mjs?4e1b:25:1) at eval (_async_to_generator.mjs?4e1b:32:1) at new Promise () at eval (_async_to_generator.mjs?4e1b:21:1) at handleSubmit (GravityToEthBridge.js?a307:172:32) at HTMLUnknownElement.callCallback (react-dom.development.js?ac89:4164:1) at Object.invokeGuardedCallbackDev (react-dom.development.js?ac89:4213:1) at invokeGuardedCallback (react-dom.development.js?ac89:4277:1) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js?ac89:4291:1) at executeDispatch (react-dom.development.js?ac89:9041:1) at processDispatchQueueItemsInOrder (react-dom.development.js?ac89:9073:1) at processDispatchQueue (react-dom.development.js?ac89:9086:1) at dispatchEventsForPlugins (react-dom.development.js?ac89:9097:1) at eval (react-dom.development.js?ac89:9288:1) at batchedUpdates$1 (react-dom.development.js?ac89:26140:1) at batchedUpdates (react-dom.development.js?ac89:3991:1) at dispatchEventForPluginEventSystem (react-dom.development.js?ac89:9287:1)

srph commented 1 year ago

Seems like it hasn't been published yet @kombos

image

kombos commented 1 year ago

Seems like it hasn't been published yet @kombos

image

any ideas as to when this will get published ? our product development is kinda stuck because of this and hoping for a resolution soon :)

srph commented 1 year ago

@kombos I would suggest directly using the git commit that fixes this. Something like:

"@cosmos-kit/react": "git@github.com:cosmology-tech/cosmos-kit.git#4f0f2a8f803cad0b518974192043fbc4514c7314"
kombos commented 1 year ago

@kombos I would suggest directly using the git commit that fixes this. Something like:

"@cosmos-kit/react": "git@github.com:cosmology-tech/cosmos-kit.git#4f0f2a8f803cad0b518974192043fbc4514c7314"

I tried to import like this and didnt work. during yarn install, it is asking which version number to install, with options same as npm registry semvers (1.0.4, 1.0.3, etc.) .. since the actual package for @cosmos-kit/react exists here : https://github.com/cosmology-tech/cosmos-kit/tree/main/packages/react, do we have to mention this location, alongwith commit hash ?