Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

TypeError: Cannot read property 'number' of null #3132

Closed
naszam opened this issue Jun 29, 2020 · 10 comments
Closed

TypeError: Cannot read property 'number' of null #3132

naszam opened this issue Jun 29, 2020 · 10 comments

Comments

@naszam
Copy link

naszam commented Jun 29, 2020

Hi,

I'm trying to deploy on Kovan via:

$ truffle migrate --network kovan

I'm getting the following:

/home/sencha/maker-badges/node_modules/@trufflesuite/web3-provider-engine/index.js:219
    number:           ethUtil.toBuffer(jsonBlock.number),
TypeError: Cannot read property 'number' of null
    at toBufferBlock (/home/sencha/maker-badges/node_modules/@trufflesuite/web3-provider-engine/index.js:219:50)
    at /home/sencha/maker-badges/node_modules/@trufflesuite/web3-provider-engine/index.js:60:27
    at /home/sencha/maker-badges/node_modules/@trufflesuite/web3-provider-engine/index.js:136:12
    at /home/sencha/maker-badges/node_modules/@trufflesuite/web3-provider-engine/index.js:199:9
    at /home/sencha/maker-badges/node_modules/async/internal/once.js:12:16
    at replenish (/home/sencha/maker-badges/node_modules/async/internal/eachOfLimit.js:61:25)
    at /home/sencha/maker-badges/node_modules/async/internal/eachOfLimit.js:71:9
    at eachLimit (/home/sencha/maker-badges/node_modules/async/eachLimit.js:43:36)
    at /home/sencha/maker-badges/node_modules/async/internal/doLimit.js:9:16
    at end (/home/sencha/maker-badges/node_modules/@trufflesuite/web3-provider-engine/index.js:176:5)
    at /home/sencha/maker-badges/node_modules/@trufflesuite/web3-provider-engine/subproviders/provider.js:19:5
    at XMLHttpRequest.request.onreadystatechange (/home/sencha/maker-badges/node_modules/web3-providers-http/src/index.js:96:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/sencha/maker-badges/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
    at XMLHttpRequest._setReadyState (/home/sencha/maker-badges/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
    at XMLHttpRequest._onHttpResponseEnd (/home/sencha/maker-badges/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
    at IncomingMessage.<anonymous> (/home/sencha/maker-badges/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1201:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

I'm using:

  • Truffle v5.1.32
  • @truffle/hdwallet-provider v1.0.36
  • Ubuntu 18.04
  • npm v13.13.0
@gnidan gnidan transferred this issue from trufflesuite/truffle-hdwallet-provider Jun 29, 2020
@CruzMolina
Copy link
Contributor

Thanks for reporting @naszam ! @ltfschoen has a fix for this in trufflesuite/provider-engine#6. Closing as a duplicate of #3130 .

@CruzMolina
Copy link
Contributor

Until this goes out in our official weekly release, the fix for this is out at @truffle/hdwallet-provider@next.

Please give it a shot and let us know if this particular error has been resolved! 🙏

@naszam
Copy link
Author

naszam commented Jun 30, 2020

Great! Thanks!
I'll do it!

@naszam
Copy link
Author

naszam commented Jun 30, 2020

It worked! Thanks a lot!

@garethcurtis
Copy link

Hi - not sure if this is helpful or not but FYI....

I was using
truffle console --network ropsten
And then once connected:
migrate --reset

And the above error still occurs for me, even in 5.1.33. Connect to the network, within 20 seconds or so, that error appears.

However, I did what naszam said and instead used:
truffle migrate --network ropsten

And it's all good. Thanks!

@CruzMolina
Copy link
Contributor

Hey @garethcurtis, are you using @truffle/hdwallet-provider@latest?

@garethcurtis
Copy link

Hi @CruzMolina does that came as part of 5.1.33? I assumed so... If not then sorry, nope.

@CruzMolina
Copy link
Contributor

@garethcurtis , @truffle/hdwallet-provider is a separate pkg from truffle.

@garethcurtis
Copy link

OK, sorry, new to this. I normally do Objective C/Swift on iOS :)

I thought hdwallet-provider came as part of @trufflesuite/web3-provider-engine@14.0.7. Apologies. I will try and figure out how to get hdwallet-provider separately! Thanks @CruzMolina

I managed to get the contract deployed anyway, so all good from that perspective.

@CruzMolina
Copy link
Contributor

No worries @garethcurtis , @truffle/hdwallet-provider includes @trufflesuite/web3-provider-engine as a dependency. To install and use @truffle/hdwallet-provider, run npm install @truffle/hdwallet-provider and see the README for configuration.

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

No branches or pull requests

3 participants