Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

web3.toUtf8 is not a function #35

Open
kenzo0202 opened this issue Mar 15, 2018 · 1 comment
Open

web3.toUtf8 is not a function #35

kenzo0202 opened this issue Mar 15, 2018 · 1 comment

Comments

@kenzo0202
Copy link

kenzo0202 commented Mar 15, 2018

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)

@ZainaliSyed
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants