hardhat-gas-reporter
hardhat-gas-reporter copied to clipboard
hardhat test fails with TypeError: nativeNC failed when hardhat-gas-reporter enabled
Regardless of what ever I tried, hardhat-gas-reporter fails always with nativeNC failed exception.
Made sure there is no eth-gas-reporter
installed, and my hardhat config has only enabled: true
, and removed all other options like coinmarketcap, currency, token
etc. to ensure they are not causing the exception.
The tests passes successfully (with network localhost
and hardhat
) if I comment out or remove require("hardhat-gas-reporter")
, so tests are not the problem.
Tried with networks, hardhat, localhost, testnets (rinkeby, goerli)
, nothing helped.
Any help is much appreciated.
$ npx hardhat test --network localhost An unexpected error occurred:
TypeError: nativeNC failed:
at createInvalidReporterError (D:\development\carbon\cct\node_modules\mocha\lib\errors.js:207:13)
at Mocha.reporter (D:\development\carbon\cct\node_modules\mocha\lib\mocha.js:343:17)
at new Mocha (D:\development\carbon\cct\node_modules\mocha\lib\mocha.js:196:6)
at SimpleTaskDefinition.action (D:\development\carbon\cct\node_modules\hardhat\src\builtin-tasks\test.ts:95:21)
at Environment._runTaskDefinition (D:\development\carbon\cct\node_modules\hardhat\src\internal\core\runtime-environment.ts:219:14)
at Environment._runTaskDefinition (D:\development\carbon\cct\node_modules\hardhat\src\internal\core\runtime-environment.ts:219:14)
at Environment.run (D:\development\carbon\cct\node_modules\hardhat\src\internal\core\runtime-environment.ts:131:14)
at SimpleTaskDefinition.action (D:\development\carbon\cct\node_modules\hardhat\src\builtin-tasks\test.ts:159:28)
at Environment._runTaskDefinition (D:\development\carbon\cct\node_modules\hardhat\src\internal\core\runtime-environment.ts:219:14)
at Environment._runTaskDefinition (D:\development\carbon\cct\node_modules\hardhat\src\internal\core\runtime-environment.ts:219:14) {
code: 'ERR_MOCHA_INVALID_REPORTER', reporter: 'D:\development\carbon\cct\node_modules\eth-gas-reporter\index.js' }
$ npm list | grep gas-report
$ npm list -g | grep gas-report
I got a similar error message! Did you find any solution?
+1
[ERR_MOCHA_INVALID_REPORTER](code: 'ERR_MOCHA_INVALID_REPORTER',)
Never got it working. It's working in vm. So seems that's the only workaround for me now.
Same issue for me, node 16.18.0. MacOS. Works fine same repo for Ubuntu 20 same node version.
Am testing in Node 16 locally on a Mac and it's fine. This may have self-resolved. Please ping if anyone continues to run into it.