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

Source "xxx" not found hint #453

Open
zhiqiangxu opened this issue Mar 31, 2024 · 12 comments
Open

Source "xxx" not found hint #453

zhiqiangxu opened this issue Mar 31, 2024 · 12 comments

Comments

@zhiqiangxu
Copy link

zhiqiangxu commented Mar 31, 2024

image

It shows Source "forge-std/Test.sol" not found: File import callback not supported but if I click on it, it can jump to the target file with no problem.

But the error hint is annoying and might as well deserve an issue here.

It can be reproduced by downloading this repo.

@startswithaj
Copy link

I have this error constantly. If I restart vs-code it disappears for a while but inevitably comes back. Any tips on how to get rid of it/disable this?

@maikelordaz
Copy link

This such a bother. hate it every day, much more than the stack too deep

@BTBMan
Copy link

BTBMan commented Sep 9, 2024

Same issue.

@peterblockman
Copy link

Tried:

  • Created a remappings.txt file
  • Added remappings in foundry.toml
  • Included "solidity.remappings" in settings.json

No success.

@BTBMan
Copy link

BTBMan commented Oct 15, 2024

Set "solidity.Monorepo" to false can resolve it.

@peterblockman
Copy link

peterblockman commented Oct 15, 2024

It works! Thank you, @BTBMan. Note that I had to use "solidity.monoRepoSupport".

@juanfranblanco
Copy link
Owner

I think I am going to go back to solidity.momoRepoSupport = false as the default, as it affects simple test projects.

@zhiqiangxu
Copy link
Author

How does this option solve the problem?

@BrennerSpear
Copy link

Wow I burned a few hours on this 🤕

@BrennerSpear
Copy link

Wow I burned a few hours on this 🤕

But now I'm getting no errors even when I use non-existent variables - maybe that's a different problem?

@maikelordaz
Copy link

F

Wow I burned a few hours on this 🤕

But now I'm getting no errors even when I use non-existent variables - maybe that's a different problem?

For me still happens sometimes, but what worked for me is doing forge remappings > remappings.txt and deleted the remappings in the foundry.toml. That fixed the issue, but it appears again every time a vscode extension needs an update. When that happens the problem with the imports happen again and it dont say anything about other errors

@juanfranblanco
Copy link
Owner

@maikelordaz Thanks, so from all comments, it seems that it is not refreshing the remappings, when an update occurs, as those are invalidated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants