zemse / hardhat-tracer

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

hardhat-tracer `2.3.4` fails #49

Closed k06a closed 1 year ago

k06a commented 1 year ago

Updated hardhat-tracer from 2.2.2 to 2.3.4:

An unexpected error occurred:

DOMException [DataCloneError]: #<Object> could not be cloned.
    at new DOMException (node:internal/per_context/domexception:53:5)
    at structuredClone (node:internal/structured_clone:23:17)
    at /Users/k06a/Projects/address-token/node_modules/@ungap/structured-clone/cjs/index.js:21:46
    at /Users/k06a/Projects/address-token/node_modules/hardhat-tracer/src/extend/config.ts:22:45
    at loadConfigAndTasks (/Users/k06a/Projects/address-token/node_modules/hardhat/src/internal/core/config/config-loading.ts:122:5)
    at main (/Users/k06a/Projects/address-token/node_modules/hardhat/src/internal/cli/cli.ts:200:62)
    at Object.<anonymous> (/Users/k06a/Projects/address-token/node_modules/hardhat/src/internal/cli/cli.ts:377:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
zemse commented 1 year ago

Can you share hardhat config that was passed to tracer?

k06a commented 1 year ago

https://github.com/1inch/address-token/blob/master/hardhat.config.js

zemse commented 1 year ago

I tried installed hardhat-tracer@2.3.4 on commit b426e69f of 1inch/address-token and yarn test:ci --trace seemed to work. Can you provide steps you are taking to reproduce?

This problem was introduced in 2.3.3 which should have been fixed using https://github.com/zemse/hardhat-tracer/commit/48c2b17e2d898d5a8589876ee127f2052f3d2751 and released in 2.3.4. Related https://github.com/zemse/hardhat-tracer/issues/48#issuecomment-1574949963.

k06a commented 1 year ago

yarn test command fails for me. Have same issue in some private repos also.

k06a commented 1 year ago

I see it works in CI: https://github.com/1inch/address-token/actions/runs/5236588609/jobs/9454232625?pr=3

But fails locally, my setup:

zemse commented 1 year ago

Seems some differences with structuredClone on newer node version, I've removed it's use. I've pushed a fix in 2.3.5, can you please try if it works?

k06a commented 1 year ago

@zemse thank you! Your fix works, version 2.3.5 is fine