web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

Uncaught TypeError: e.slice is not a function web3.min.js:1

Open shahzadthathal opened this issue 8 years ago • 4 comments

I'm getting this error when using web3.eth.accounts.create, I have latest web3.js code(web3.js-1.0.0-beta.34).

$(function(){

 web3.eth.accounts.create(function(err, res){
        console.log("Account:"+res);
  });

});
web3.min.js:1 Uncaught TypeError: e.slice is not a function
    at Object.concat (web3.min.js:1)
    at Object.create (web3.min.js:1)
    at _.create (web3.min.js:1)
    at HTMLDocument.<anonymous> (home:146)
    at i (jquery.js:2)
    at Object.fireWith [as resolveWith] (jquery.js:2)
    at Function.ready (jquery.js:2)
    at HTMLDocument.J (jquery.js:2)

shahzadthathal avatar Apr 18 '18 17:04 shahzadthathal

Also getting this error message when using web3.eth.accounts.recover(secretHashMessage, v, r, s, true);

vindberg avatar Sep 03 '18 12:09 vindberg

@shahzadthathal I think you are using the function incorrectly. According to docs the function does not support callback.

@vindberg the same happened to me when I forgot to prefix the message with the signature prefix "\x19Ethereum Signed Message:\n" + msg.length + msg. You should either do that or omit the last param and it happens automatically

chmelva4 avatar Oct 29 '18 14:10 chmelva4

Yes, damn prefix :) Thanks for getting back.

vindberg avatar Oct 30 '18 07:10 vindberg

@shahzadthathal I think you are using the function incorrectly. According to docs the function does not support callback.

@vindberg the same happened to me when I forgot to prefix the message with the signature prefix "\x19Ethereum Signed Message:\n" + msg.length + msg. You should either do that or omit the last param and it happens automatically

thanks now I'm using web3js package in Nodejs server, I deleted above code :)

shahzadthathal avatar Jan 12 '19 05:01 shahzadthathal