Metamask-extension: Broken method signature.

Created on 20 Sep 2018  路  9Comments  路  Source: MetaMask/metamask-extension

Calling web3.eth.getTransactionCount method results in the following error:
MetaMask - RPC Error: TypeError: r is not a function

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://oasis.direct
  2. Click on "Continue" next to the Metamask label
  3. Leave it as it is and sell ETHfor DAI.
  4. Open the dev console
  5. When asked to sign the TX , just do it.
  6. UI gets frozen on Signing Transaction state.
  7. There is an error thrown in the dev console

Expected behavior
Sign the transaction successfully without throwing any errors.

image

image

Browser details (please complete the following information):

  • OS: Linux
  • Chrome Version 67.0.3396.99 (Official Build) (64-bit)
  • MetaMask Version 4.10.0
  • Beta UI
  • web3 0.20.6 ( local instance with injected provider )
    Additional context
    This is quite important. We have a method that is listening for all the pending transactions for a given address.
export const getTransactionCount = address => {
  return promisify(web3.eth.getTransactionCount)(address, "pending");
}

The problem comes from the second argument. If we remove it, everything works fine but if we leave it as it is now, everything is broken. According to the method signature https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethgettransactioncount the first argument is the address , second one is Number|String and third one is a Function.

I think somehow you guys skip passing the second argument and instead you pass the third one as second and this is where the confusing comes from.

It was working fine so far but since the latest version things are broken.

Also have in mind that we tried infura nodes directly through our hardware wallet support so on the node side everything works fine ( unless you have some dedicated node )

Please elaborate as soon as possible!

@danfinlay @kumavis @alextsg

N02-needsReproduction T00-bug

Most helpful comment

The same problem with it in chrome browser: TypeError: r is not a function at chrome- . When you fix it already? It happens in tokenstore, forkdelta, etc.. Return the previous normal version please and don't touch anything more, thanks.

All 9 comments

hey @peculiarity - I went through the flow at oasis.direct and also got the error you mentioned. However, my UI never froze on the "signing transaction" state and the transaction went through (Etherscan). And I now have 30 DAI 馃槃

I'm on MM v4.10 and Chrome 69 - have you tried in other browsers? And would you mind sending your state logs to [email protected] and mentioning this issue number? They might help us debug how you got stuck in this state.

cc @danjm

@bdresser As I have mention the UI gets stuck but transaction passes. The problem is when you query for existing pending transactions which doesnt affect the happy path. If its on Main then congrats on the DAI

UI gets frozen on Signing Transaction state.

Do you mean the extension freezes with the spinner overlay on top of the confirmation screen? or do you mean the transaction just stays as pending even once it's confirmed?

Might be related to #5174, we're investigating.

I'm the UI of the dapp :) (probably shouldn't have mentioned it since it's not explicitly metamask but it is a result of Metamask not being able to perform the getTransactionCount call. )

image

YOu have mentioned that you were able to reproduce it but the issue itself is marked with a label needsReproduction

The same problem with it in chrome browser: TypeError: r is not a function at chrome- . When you fix it already? It happens in tokenstore, forkdelta, etc.. Return the previous normal version please and don't touch anything more, thanks.

I can confirm this Error. Appears on tokenstore when trying to cancel an open order:
bildschirmfoto 2018-09-23 um 18 02 09

macOS 10.13.6, Chrome 69.0.3497.100

Confirming that our users are facing issues. Seems you can reproduce by attempting to cancel a trade with latest version of Metamask on http://token.store/.

@tmashuang When should we expect the release of the fix?

@peculiarity @itokenstore it seems to be fixed:
(source #5323 )

Was this page helpful?
0 / 5 - 0 ratings