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:
https://oasis.direct"Continue" next to the Metamask labelETHfor DAI.dev consoleSigning Transaction state.dev consoleExpected behavior
Sign the transaction successfully without throwing any errors.


Browser details (please complete the following information):
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
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. )

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:
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 )
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.