react-auth-box icon indicating copy to clipboard operation
react-auth-box copied to clipboard

web3.toUtf8 is not a function

Open kenzo0202 opened this issue 7 years ago • 1 comments
trafficstars

I got error "TypeError: web3.toUtf8 is not a function" in LoginButtonActions.js. Maybe, web3.js(ver1.0.0) made toUtf8() method deprecated.(https://web3js.readthedocs.io/en/1.0/web3-utils.html?highlight=toutf8#hextoutf8) So I fixed this problem like below. I wish you change source code.

var userName = web3.toUtf8(result)

var userName = web3.utils.hexToUtf8(result)

kenzo0202 avatar Mar 15 '18 02:03 kenzo0202

Thank you it's working you need to console WEB3 let web3 = store.getState().web3.web3Instance; console.log("loginUser : ", web3);

  • var userName = web3.utils.toUtf8(result); // will work fine

ZainaliSyed avatar Sep 25 '18 09:09 ZainaliSyed