You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm spawning a child process to run with the HRE, eg. npx hardhat run someRandomScript.ts, and with the hardhat-tracer imported in the hardhat.config.ts, I get a different behavior than without the tracer module imported. The different behavior is that, with the tracer imported, the child process does not exit.
Steps To Reproduce
Create a file called someRandomScript.ts in a hardhat project:
// someRandomScript.tsconsole.log("THIS");
Run with npx hardhat run scripts/thing.ts
Observe the script just hang.
Comment out the console.log
Run with the same command in step 2.
Observe the script exit gracefully.
Versions
hardhat@2.15.0
hardhat-tracer@2.5.1
node@18.15.0
yarn@1.22.19
Platform
Macbook Pro 2021
Chip: Apple M1 Pro
OS: macOS Ventura 13.3
The text was updated successfully, but these errors were encountered:
This is a behaviour of nodejs when async tasks are not completed or get hanged. There are quite a lot of async tasks, I'll look into this issue which one gets hanged.
But if you are blocked by this problem, as a workaround you can add to the end of someRandomScript.ts:
// .. after your code runs:process.exit()// this will stop the process ignoring any background pending async tasks if any
What
When I'm spawning a child process to run with the HRE, eg.
npx hardhat run someRandomScript.ts
, and with thehardhat-tracer
imported in thehardhat.config.ts
, I get a different behavior than without the tracer module imported. The different behavior is that, with the tracer imported, the child process does not exit.Steps To Reproduce
someRandomScript.ts
in a hardhat project:npx hardhat run scripts/thing.ts
console.log
Versions
hardhat@2.15.0
hardhat-tracer@2.5.1
node@18.15.0
yarn@1.22.19
Platform
Macbook Pro 2021
Chip: Apple M1 Pro
OS: macOS Ventura 13.3
The text was updated successfully, but these errors were encountered: