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

1.0: TypeError: Cannot read property 'length' of undefined

Open thisbejim opened this issue 9 years ago • 12 comments

When calling a contract method that does not have any arguments I am getting the following error: TypeError: Cannot read property 'length' of undefined.

It looks to be coming from _encodeMethodABI where args is undefined rather than an array.

thisbejim avatar Jul 26 '17 03:07 thisbejim

There is a bug here. See my post and answer here:

https://ethereum.stackexchange.com/a/23062/7132

chchmatt avatar Jul 26 '17 05:07 chchmatt

Will be fixed in the next version, thanks for noticing.

frozeman avatar Jul 26 '17 11:07 frozeman

Should be fixed in beta.12

frozeman avatar Jul 26 '17 17:07 frozeman

Thanks. Keep up the great work!

chchmatt avatar Jul 26 '17 19:07 chchmatt

Hello. It's still happening in 1.0.0-beta.24.

SergeSysoev avatar Nov 08 '17 13:11 SergeSysoev

Pls reopen this issue still exists in beta27 :)

nivida avatar Jan 23 '18 00:01 nivida

I installed beta.48....still exists

scientistnik avatar Mar 19 '19 16:03 scientistnik

Still exists on 1.3.4, how to solve?

rayyan808 avatar Jun 03 '21 13:06 rayyan808

Still exists on 1.6.1

mayankjindalmj avatar Feb 03 '22 10:02 mayankjindalmj

The bug still exists in 2.9.6

0xrishavsharma avatar May 30 '22 19:05 0xrishavsharma

Still exists on 1.7.3

luisantoniocrag avatar May 31 '22 18:05 luisantoniocrag

actually you should check your data if there is not undefined

rafaelmrdyn avatar Jul 07 '22 15:07 rafaelmrdyn