trufflesuite / drizzle

Reactive Ethereum dapp UI suite
906 stars 235 forks source link

Error in block processing: TypeError: Cannot read property 'transactions' of null when using web3 fallback (infura) #56

Open friedhelmensch opened 5 years ago

friedhelmensch commented 5 years ago

When using the web3 fallback (in my case infura). I am seeing an exception in the console

    Error in block processing:
    TypeError: Cannot read property 'transactions' of null
     at processBlock\$ (drizzle-store.js:17570)
     at tryCatch (drizzle-store.js:14312)
     at Generator.invoke [as \_invoke](drizzle-store.js:14531)
     at Generator.prototype.<computed> [as next](drizzle-store.js:14365)
     at next (proc.js:362)
     at currCb (proc.js:449)
     at proc.js:567
     at exec (scheduler.js:20)
     at flush (scheduler.js:63)
     at asap (scheduler.js:35)
     at runPutEffect (proc.js:553)
     at runEffect (proc.js:496)
     at next (proc.js:366)
     at proc (proc.js:314)
     at resolveIterator (proc.js:521)
     at runCallEffect (proc.js:584)
     at runEffect (proc.js:496)
     at next (proc.js:366)
     at currCb (proc.js:449)

I created an example repo to reproduce the problem: https://github.com/friedhelmensch/drizzle-transaction-null-issue

cds-amal commented 5 years ago

Hi @friedhelmensch ,

Is there a truffle project associated with your reproduction? Drizzle needs to be configured to know what deployed contracts to connect to on the testnet. Can you please include those in the reproduction?

friedhelmensch commented 5 years ago

hey @cds-amal, I don´t have a truffle project directly associated with it but a contract on the main net. I updated the example repo with the smart contract (on the main net).

https://github.com/friedhelmensch/drizzle-transaction-null-issue/commit/a8d4d006aca7a7fbc59370194cff898784ce04aa

MrRefactoring commented 5 years ago

@friedhelmensch thanks for your example. Your error is reproducing.

I walked through the debugger and found that the event about the new block comes a little earlier than it can be received from the network. It’s hard to say why this is happening.

Probably, this may be a mistake on the part of infura. I found a similar issue in the web3 repository

hbarcelos commented 4 years ago

Any updates here? I'm having the same issue.

SebDigital commented 4 years ago

Same issue here if trying to connect Wallet other than Metamask Project is on Ropsten Test network https://immutablepost.com/ If you click on Connect Wallet and choose Fortmatic for example Thanks!

SebDigital commented 4 years ago

Actually, not sure but I have added: syncAlways:true, To the Drizzle option and it seems the error is not showing anymore..