Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sentry-io bot opened this issue Apr 28, 2023 · 1 comment
Closed
Labels
status:ready This issue is ready to be worked on type:bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Apr 28, 2023

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}
@kanej
Copy link
Member

kanej commented May 1, 2023

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:

@kanej kanej added status:ready This issue is ready to be worked on and removed status:triaging labels May 1, 2023
@kanej kanej moved this to Todo in hardhat-vscode May 1, 2023
@kanej kanej added the type:bug Something isn't working label May 1, 2023
@kanej kanej closed this as completed in e039184 May 3, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in hardhat-vscode May 3, 2023
kanej pushed a commit that referenced this issue May 3, 2023
Instead of passing Ape/Truffle/Foundry initialization errors to sentry, we log for the user only.

We don't rethrow truffle project errors, matching the pattern used in other adapters.

Resolves #473.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on type:bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

1 participant