cryptochain icon indicating copy to clipboard operation
cryptochain copied to clipboard

TypeError: Cannot read properties of undefined (reading 'hash')

Open rcturner7 opened this issue 3 years ago • 0 comments

I'm on Chapter 3, I started getting this error in around section 15 and this failed error in test is not going away. I am now on section 18 in chapter 3. I have gone back to chapter 2 all sections trying to figure out if I missed something.

When I run test it shows this error that is not in the videos failed test:

TypeError: Cannot read properties of undefined (reading 'hash') 16 | static mineBlock({ lastBlock, data }) { 17 | const timestamp = Date.now(); 18 | const lastHash = lastBlock.hash; | ^ 19 | 20 | return new this({ 21 | timestamp,

at Function.mineBlock (block.js:18:32) at Blockchain.addBlock (blockchain.js:9:32) at Object. (blockchain.test.js:37:28)

The arrow on 18 in my command prompt points at the .hash in = lastBlock.hash.

If someone could help me figure out why my command prompt the tests can't read properties of hash?

rcturner7 avatar Feb 07 '22 20:02 rcturner7