TypeError: Cannot read properties of undefined (reading 'tracer')
Closed this issue · 6 comments
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
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).
@zemse Yes, and if I don't attempt to set nameTags, hardhat-tracer works as expected.
Any more thoughts? If you need more info about my setup, I can share. I think it is a pretty standard hardhat project though.
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.
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.
Yep works fine now 🥳