question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unable to transfer balance using nuxtjs

See original GitHub issue

OS: MacOS NodeJS: v10.15.3 Framework Used: NuxtJS v2.4

@polkadot/api: 0.48.0-beta.0 @polkadot/keyring: 0.40.1 @polkadot/rpc-core: 0.50.1 @polkadot/rpc-provider: 0.50.1 @polkadot/uti": 0.40.1

I want to simply test the balance transfer using the following code:

      api = await ApiPromise.create(provider)
      const BOB_ADDR = '5EJE8xBKreaDSRpTW7o9EqRYP6RUZgrChPpL9Uj4hBj4osMi';
      
      const keyring = new Keyring();
      const alice = keyring.addFromSeed(hexToU8a('0x7fd11e3074709b1f3fa2474a68b1c189fef5f6e769f48fb3bc23469180fdf131'))

      const transfer = api.tx.balances.transfer(BOB_ADDR, 10);
      const result = await transfer.signAndSend(alice);
      console.log(Object.keys(api.tx.balances))  // it returns ["transfer", "setBalance"]
      console.log('tx result :', result)


When executing the function call, that’s what I got, but it works in a normal nodejs app.

index.js:64494 2019-03-26 01:13:05        RPC-CORE: submitExtrinsic (extrinsic: Extrinsic): Hash:: Calling Method.findFunction before extrinsics have been injected.
apply @ index.js:64494
error @ index.js:64540
call @ index.js:45712
(anonymous) @ index.js:44213
rxOnCall @ index.js:1688
method @ index.js:2067
sendObservable @ index.js:2294
pipe @ index.js:2357
push../node_modules/rxjs/_esm5/internal/operators/switchMap.js.SwitchMapSubscriber._next @ index.js:154535
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext @ index.js:152500
push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next @ index.js:146141
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
(anonymous) @ index.js:157688
Promise.then (async)
(anonymous) @ index.js:157686
subscribeToResult @ index.js:157723
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._innerSub @ index.js:152490
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._tryNext @ index.js:152484
push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber._next @ index.js:152467
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
push../node_modules/rxjs/_esm5/internal/operators/tap.js.TapSubscriber._next @ index.js:154943
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
push../node_modules/rxjs/_esm5/internal/operators/take.js.TakeSubscriber._next @ index.js:154655
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next @ index.js:152216
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ index.js:146951
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next @ index.js:146694
push../node_modules/rxjs/_esm5/internal/ReplaySubject.js.ReplaySubject.nextInfiniteTimeWindow @ index.js:146513
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next @ index.js:146951
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
push../node_modules/rxjs/_esm5/internal/operators/map.js.MapSubscriber._next @ index.js:152216
push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next @ index.js:146928
result @ index.js:44243
update @ index.js:45753
WsProvider.onSocketMessageSubscribe.response @ index.js:46299
WsProvider.onSocketMessage.message @ index.js:46243
index.js:44214 ExtError: submitExtrinsic (extrinsic: Extrinsic): Hash:: Calling Method.findFunction before extrinsics have been injected.
    at call (http://localhost:3000/_nuxt/vendors.pages/index.js:45713:15)
    at http://localhost:3000/_nuxt/vendors.pages/index.js:44213:44
    at rxOnCall (http://localhost:3000/_nuxt/vendors.pages/index.js:1688:10)
    at Object.method [as submitExtrinsic] (http://localhost:3000/_nuxt/vendors.pages/index.js:2067:18)
    at sendObservable (http://localhost:3000/_nuxt/vendors.pages/index.js:2294:27)
    at SwitchMapSubscriber.pipe [as project] (http://localhost:3000/_nuxt/vendors.pages/index.js:2357:67)
    at SwitchMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/switchMap.js.SwitchMapSubscriber._next (http://localhost:3000/_nuxt/vendors.pages/index.js:154535:27)
    at SwitchMapSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (http://localhost:3000/_nuxt/vendors.pages/index.js:146928:18)
    at MergeMapSubscriber.push../node_modules/rxjs/_esm5/internal/operators/mergeMap.js.MergeMapSubscriber.notifyNext (http://localhost:3000/_nuxt/vendors.pages/index.js:152500:26)
    at InnerSubscriber.push../node_modules/rxjs/_esm5/internal/InnerSubscriber.js.InnerSubscriber._next (http://localhost:3000/_nuxt/vendors.pages/index.js:146141:21)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ansonla3commented, Mar 26, 2019

@jacogr I think that’s related to have multiple version of @polkadot/types in the lock file. after removing the lock file & rm -rf node_module & yarn install again. it works! @xlc thanks

0reactions
polkadot-js-botcommented, Jun 5, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt.js & Vue.js jest returns error: “don't know how to turn this ...
So what can we do about it for now? Solution 1: Wait for the latest npm package conflicts to resolve. Wait for the...
Read more >
Module build failed for Saas Loader - NuxtJS - Stack Overflow
I am trying to use scss like below in my nuxt application. But this is not working and throwing module failed error. I...
Read more >
Data Fetching - Nuxt
In Nuxt we have 2 ways of getting data from an API. We can use the fetch method or the asyncData method. Nuxt...
Read more >
Getting Started With Nuxt - Smashing Magazine
In this tutorial, we're going to learn how to create server-side rendered applications by using Nuxt.js, how to configure your application ...
Read more >
Tips You Must Know to Build Vue.js Projects with Nuxt.js
When it comes to fetching data Nuxt.js still accepts the Vue.js hook mounted() , which can't be called before rendering the page. To...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found