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

Error: Truffle module not found. Ensure it's installed globally or locally.

sentry-io opened this issue · comments

Lets suppress this in sentry. It is also bubbling through as an unhandled exception. We should stop this.

Sentry Issue: VSCODE-EXTENSION-WMA

Error: Truffle module not found. Ensure it's installed globally or locally.
  File "/Users/xia/.vscode/extensions/nomicfoundation.hardhat-solidity-0.7.0/server/out/index.js", line 2901, in TruffleProject.initialize
    '{snip} ly.";throw this.status=3,this.initializeError=errorMessage,new Error(errorMessage)}try{delete require.cache[require.resolve(this.configPath) {snip}
  File "/Users/xia/.vscode/extensions/nomicfoundation.hardhat-solidity-0.7.0/server/out/index.js", line 2901, in TruffleProject.onWatchedFilesChanges
    '{snip} `Reinitializing truffle project: ${this.id()}`),await this.initialize())}async _resolveDeployedAddresses(){try{let contractFiles=await(0,imp {snip}
  File "/Users/xia/.vscode/extensions/nomicfoundation.hardhat-solidity-0.7.0/server/out/index.js", line 2939, in <anonymous>
    '{snip} oject of Object.values(serverState.projects))await project.onWatchedFilesChanges(params)}}var debounce=(func,wait,immediate)=>{let timeout=n {snip}

Taking a look at the truffle unhandled exceptions, I suspect it is related to us rethrowing errors in initialize:

throw new Error(errorMessage);

If you look at the foundry project as a comparison, we store a representation of the error within the project, but don’t rethrow: