You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
run yarn dock-did-example, error "TypeError: this.module.newOnchain is not a function" #346
Creating DID resolvers...
Building DIDs list...
Error occurred somewhere, it was caught! TypeError: this.module.newOnchain is not a function
at DIDModule.createNewOnchainTx (/Users/xxxxx/Downloads/sdk-master/src/modules/did/did.js:143:24)
at DIDModule.new (/Users/xxxxx/Downloads/sdk-master/src/modules/did/did.js:167:12)
at registerNewDIDUsingPair (/Users/xxxxx/Downloads/sdk-master/tests/integration/helpers.js:25:25)
at createDockDID (/Users/xxxxx/Downloads/sdk-master/example/resolver.js:55:32)
at main (/Users/xxxxx/Downloads/sdk-master/example/resolver.js:78:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
changed the title [-]TypeError: this.module.newOnchain is not a function[/-][+]run yarn dock-did-example, error "TypeError: this.module.newOnchain is not a function"[/+]on Apr 10, 2023
Can you share your docker image id and SDK version because this.module.newOnchain is not a function suggests an old docker image?
Creating DID resolvers...
Building DIDs list
The output logs suggest you're running yarn did-resolver-example and not yarn dock-did-example. Secondly using the mainnet tagged docker images to run examples and tests isn't a good idea as it will cost you real tokens.
Can you share the most recent block on your node? The TypeError might be because your local node doesn't have the recent blocks (last few months) and as per your local state, newOnchain is not an extrinsic as it was only introduced a few months ago.
Activity
[-]TypeError: this.module.newOnchain is not a function[/-][+]run yarn dock-did-example, error "TypeError: this.module.newOnchain is not a function"[/+]lovesh commentedon Apr 10, 2023
Can you share your docker image id and SDK version because
this.module.newOnchain is not a functionsuggests an old docker image?The output logs suggest you're running
yarn did-resolver-exampleand notyarn dock-did-example. Secondly using themainnettagged docker images to run examples and tests isn't a good idea as it will cost you real tokens.kangkang333 commentedon Apr 10, 2023
SDK version: master
dock-substrate: version 0.22.0
And I run the following command :
docker run -p 9944:9944 -p 30333:30333 docknetwork/dock-substrate:mainnet --chain ./cspec/knox_raw.json --ws-external --enable-offchain-indexing=true
2023-04-10 08:07:06 Dock Node
2023-04-10 08:07:06 ✌️ version 0.22.0
2023-04-10 08:07:06 ❤️ by Dock.io, 2017-2023
2023-04-10 08:07:06 📋 Chain specification: Dock PoS Mainnet
2023-04-10 08:07:06 🏷 Node name: imported-learning-5413
2023-04-10 08:07:06 👤 Role: FULL
lovesh commentedon Apr 10, 2023
Can you share the most recent block on your node? The
TypeErrormight be because your local node doesn't have the recent blocks (last few months) and as per your local state,newOnchainis not an extrinsic as it was only introduced a few months ago.GinMu commentedon Mar 29, 2024
i also have this problem on mainnet, docker image log is:

then i run connect command:
then run
yarn dock-did-examplethat throwsthis.module.newOnchain is not a functionerror. But not throw this error on testnet.