Hi,
In GSN tutorial, When compiling the Counter contract(oz compile) I got the following errors(in short):
Compiling contracts with solc 0.5.11 (commit.c082d0b4)
Compilation errors:
@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol:4:1: ParserError:
Source "@openzeppelin/contracts-ethereum-package/contracts/GSN/IRelayRecipient.sol" not found: File import callback not supported
import "./IRelayRecipient.sol";
^-----------------------------^
@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol:5:1: ParserError: Source "@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNContext.sol" not found: File import callback not supported
import "./GSNContext.sol";
^------------------------^
Environment
Windows 10 pro
node 10.16.3 and npm 6.9.0 @openzeppelin/cli@2.5.3 @openzeppelin/contracts-ethereum-package@2.2.3 @openzeppelin/upgrades@2.5.3
Truffle 5.0.25
Details
Just followed the GSN tutorials on Windows 10
I have searched similar problems of “File import callback not supported” in truffle-suite issues, but no help.
Code to reproduce
npm init -y
oz init
paste Counter.sol to contracts directory
oz compile
Any suggestion? I don’t want to add full path to import: import “./IRelayRecipient.sol”; to import “@openzeppelin/contracts-ethereum-package/contracts/GSN/IRelayRecipient.sol”;
It is OK for Linux(I tested same thing in Docker container) but still errors on Windows(can’t find files of relative path such as import “./IRelayRecipient.sol”).
I have found the similar issues in truffle suites. I guess the causes are same as this one.
I use Windows (except for smart contract development)
Did you get a chance to try with the latest version of truffle?
If it is still occurring we should report to Truffle as it appears to be Windows specific.
just heads up I just filed an issue with pull request to support it without WSL since the connection in WSL is not really stable in my experience, so I still prefer use it natively. https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1558
I’m having the same Issue: Source “@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol” not found: File import callback not supported
Thanks, I just updated. I also solve the issue with the import by doing this way: import "../node_modules/@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol";