zemse / hardhat-tracer

🕵️ allows you to see internal calls, events and storage operations in the console
MIT License
351 stars 36 forks source link

TypeError: Cannot read properties of undefined (reading 'tracer') #11

Closed 0x6080 closed 2 years ago

0x6080 commented 2 years ago

When I tried:

 import { hre } from 'hardhat';

 // ... deploy fooContract ...
 hre.tracer.nameTags[fooContract.address] = "fooContract";

I was met with a bunch of TypeError: Cannot read properties of undefined (reading 'tracer')

How could we fix this? I'm assuming just some incompatibilities with TypeScript

zemse commented 2 years ago

Can you confirm if import 'hardhat-tracer' present in your hardhat config? If it's there maybe you can try restarting your code editor (whenever I install dependencies, vscode on my end, sometimes doesn't recognise the typescript stuff added by the package and after a restart it works).

0x6080 commented 2 years ago

@zemse Yes, and if I don't attempt to set nameTags, hardhat-tracer works as expected.

0x6080 commented 2 years ago

Any more thoughts? If you need more info about my setup, I can share. I think it is a pretty standard hardhat project though.

zemse commented 2 years ago

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

Sorry for the late response, this seems to be a runtime error, so I don't think it's an issue with types. Do you have your project public? I'm trying to reproduce this problem would appreciate the help.

zemse commented 2 years ago

I think this was because of old versions of dependencies in hardhat-tracer (since the plugin wasn't updated since long time).

Just rewrote the plugin and released v1.1.0-rc.1. If you can, please try and let me know if there are any issues with this.

0x6080 commented 2 years ago

Yep works fine now 🥳