full-blockchain-solidity-course-js
full-blockchain-solidity-course-js copied to clipboard
TypeError: Cannot read properties of undefined (reading '0')
Lesson
Lesson 15
Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")
No response
Operating System
Windows
Describe the bug
Everytime I try accessing the events array this happens
const tokenId = mintTxReceipt.events[0].args.tokenId;
This line or any similar line just doesn't work and I've practically scrapped the whole Web but can't find anything that may fix it. One gentleman had the same issue and he solved it but he never posted how and closed the issue.
Please help me. I've been stuck on this problem for weeks ever since we first started reading from events array back in lesson 9
hello Plycedes
try it this way
const tokenId = mintTxReceipt.logs[0].args.tokenId;