Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Web3 1.0.0-beta.38 TypeError: Invalid attempt to spread non-iterable instance #2223

Closed
patidarmanoj10 opened this issue Jan 27, 2019 · 5 comments · Fixed by #2232
Closed
Labels
Bug Addressing a bug

Comments

@patidarmanoj10
Copy link

Getting below error when calling myContract.methods.myMethod().call()

TypeError: Invalid attempt to spread non-iterable instance

This this was working fine in previous beta versions 37, 36 etc. When I upgraded to beta.38 I started getting above error.

@nivida
Copy link
Contributor

nivida commented Jan 27, 2019

I've tested it on my local environment and couldn't replicate this issue. Could you please use the issue template and provide all the information.

@studioTeaTwo
Copy link

I got same trouble, too.
my contract methods using openzeppelin-solidity(v2.1.2) failed even if contract.methods.totalSupply().call().
my enviroment is here.

Truffle v5.0.2 (core: 5.0.2)
Solidity v0.5.0 (solc-js)
Node v10.14.2
solc: Version: 0.5.2+commit.1df8f40c.Darwin.appleclang

@nivida nivida added Bug Addressing a bug and removed more information needed labels Jan 27, 2019
@nivida
Copy link
Contributor

nivida commented Jan 27, 2019

Tested it again and got the same error. It was because of the deep cloning of the arguments. (fixed in #2232)

@nivida nivida closed this as completed Jan 27, 2019
@patidarmanoj10
Copy link
Author

@nivida This seems to be working fine now. Thanks for providing quick fix.

@arm531
Copy link

arm531 commented Jan 29, 2019

I am getting the same error in this function:

const balanceOf = (application, web3, address) => {
  return application.contract.methods.balanceOf(address).call()
    .then(balance => {
      console.log(`[TOKEN] Balance of '${address}' is ${balance}.`);
      return { balance };
    });
};

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

Successfully merging a pull request may close this issue.

4 participants