ethereum / remix-vscode

Remix VS Code extension
99 stars 18 forks source link

import "@openzeppelin/contracts/token/ERC721/ERC721.sol" failed #10

Open 0mkara opened 3 years ago

0mkara commented 3 years ago

Error description

Compilation failed when tried to import openzeppelin contracts from node modules. Compilation failed for both Solidity and Remix compiler.

Error log

Retrieving compiler information:
Compiler using remote version: 'v0.8.4+commit.c7e474f2', solidity version: 0.8.4+commit.c7e474f2.Emscripten.clang
ParserError: Source "@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: File import callback not supported
 --> /home/0mkar/Karma/solidity-examples/openzeppelin_nft/nft.sol:4:1:
  |
4 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compilation failed with 1 errors
bunsenstraat commented 3 years ago

Did the compiler support imports before?

0mkara commented 3 years ago

I think NO it did not support node_modules import before. Not sure about the Solidity extension.

0mkara commented 3 years ago

Just confirmed node_modules imports work in JuanBlanco.solidity extension.

bunsenstraat commented 3 years ago

Ok cool, that's a good thing to communicate.

bunsenstraat commented 3 years ago

Nothing to do here right?

0mkara commented 3 years ago

No, we have to implement node_modules support for the Remix compiler we have. So keeping it open for now.

bunsenstraat commented 3 years ago

Fixed in the new release 0.0.9. Imports are handled in the same way as Remix IDE.

juil commented 1 year ago

I am also getting this error in the VS Code plugin v 0.0.12

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/