ethereum / remix-vscode

Remix VS Code extension
96 stars 20 forks source link

Remix not being able to compile files with imports #32

Open krypston104 opened 1 year ago

krypston104 commented 1 year ago

My extension is not able to compile any contract that has an import statement. This happens even if the imports are local files (located in the same folder than the compiling contract). This is a sample of the contract I try to compile with its import statement:

pragma solidity 0.4.24;

import "./Bank.sol";

contract WETH9 is ERC20Like {
    function deposit() public payable;
}

I am able to compile it with the Remid Desktop IDE, though, but for the VSC extension I just get this error:

public\contracts\Setup.sol:3:1: ParserError: Source "Bank.sol" not found: Deferred import import "./Bank.sol"; ^------------------^

Am I missing any kind of setup? I have not found anything regarding this matter.

juil commented 1 year ago

I am also getting this error.

Specifically when importing remote libraries.

eg.

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

In the Remix web app, it correctly copies the imported file and finds it at compile. But in VS Code, it downloads the file but can't find it in .deps/