send transaction should work fine.
Uncaught (in promise) TypeError: Cannot read property 'anonymous' of undefined
at AllEventsLogDecoder.decode (web3-eth-contract.umd.js:232)
at AllEventsLogDecoder.decode (web3-eth-contract.umd.js:263)
at web3-eth-contract.umd.js:627
at Array.forEach (<anonymous>)
at SendContractMethod.afterExecution (web3-eth-contract.umd.js:626)
at TransactionConfirmationWorkflow.handleSuccessState (web3-core-method.umd.js:103)
at web3-core-method.umd.js:57
const Web3 = require('web3');
const abi = [...];
const addr = '0x....';
const web3 = new Web3(window.web3.currentProvider);
const contractInstance = new web3.eth.Contract(abi, addr);
const methodArgs = [...];
contractInstance.methods.myMethod(...methodArgs).send({from, value}, (err, txHash) => {
console.log(txHash);
});
when transaction is confirmed on the blockchain, exception occurred.
Uncaught (in promise) TypeError: Cannot read property 'anonymous' of undefined
at AllEventsLogDecoder.decode (web3-eth-contract.umd.js:232)
at AllEventsLogDecoder.decode (web3-eth-contract.umd.js:263)
at web3-eth-contract.umd.js:627
at Array.forEach (<anonymous>)
at SendContractMethod.afterExecution (web3-eth-contract.umd.js:626)
at TransactionConfirmationWorkflow.handleSuccessState (web3-core-method.umd.js:103)
at web3-core-method.umd.js:57

Web3.js - 1.0.0-beta.46
Nodejs - v10.14.0
NPM - v6.4.1
Tested it with:
var Web3 = require('../../web3.js/packages/web3/dist/web3.umd.js');
var abi = require('../tokenContractAbi');
var web3 = new Web3(window.web3.currentProvider);
console.log('Version: ', web3.version);
var contract = new web3.eth.Contract(abi, '0x0ff095b6b4d215d91b4c1d7fce025a9d72afff22');
contract.methods.transfer('0x24BBE93E1D5b43233D921C9c73E15e8576bD7Be1', 1000)
.send({from: '0x9CC9a2c777605Af16872E0997b3Aeb91d96D5D8c'})
.then(function (receipt) {
console.log(receipt);
}).catch(function (error) {
console.log(error);
});
and got the following response:

Could you reference a gist file or repository here with the contract and your code example?
@nivida
when I create the contractInstance, some events' abi is missing from the contractAbi, cause the events came from the other contract.
const contractAbi = [...];
const addr = '0x....';
const contractInstance = new web3.eth.Contract(contractAbi, addr);
Then when transaction is confirmed, it will trigger these methods:
TransactionConfirmationWorkflow -> handleSuccessState -> method.afterExecution -> allEventsLogDecoder.decode
But some events' abi can not found, so that the abiItemModel will be undefined.
I think I found the guilty lines:
https://github.com/ethereum/web3.js/blob/35ebbcacbecc75a6cac033fc648d0091e0235a83/packages/web3-eth-contract/src/decoders/AllEventsLogDecoder.js#L45-L47
if the abiModel.getEventBySignature returns undefined, then in the EventLogDecoder.decode method, abiItemModel will be undefined, then line 46 will throw exception.
So in your test, you should make a transaction that can emit an event from other contract.
Yeah. I'm got this problem as well. Probably something to do with Escrow contract.
I have a similar problem. Is there a way to solve this problem?
Yeah. I'm got this problem as well. Probably something to do with Escrow contract.
Do you know what to do with escrow contract? Did you solve this problem?
@gudcjfdldu This is a web3 bug, if your transaction will trigger another contract event, web3 will trigger this bug.
I've downgraded to 1.0.0-beta.36.
@BigMurry i think Version 1.0.0-beta.37 seems to be the most stable.
Currently, web3 works fine in this version.
Thanks all for the additional information. I will fix and release this asap!
can release a new version for this bug fix? @nivida
Most helpful comment
can release a new version for this bug fix? @nivida