NomicFoundation / hardhat-vscode

Solidity and Hardhat support for Visual Studio Code

Home Page:https://hardhat.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catch exceptions when determine npm root in truffle

kanej opened this issue · comments

We are leaking unhandled exceptions during project initialization in truffle from the npm global lookup:

this.globalNodeModulesPath = execSync("npm root --quiet -g").toString();

https://github.com/NomicFoundation/hardhat-vscode/blob/9cfb24bb204bdab9b6f58f7598467205cc401887/server/src/frameworks/Truffle/TruffleProject.ts#LL61C3-L61C3

We should add a try/catch and log (but not to sentry) the issue. We should also switch from a sync call to an async call.