LimeChain/etherlime

Compiler error on contracts with imports from /contracts

elenadimitrova opened this issue · 1 comments

Compiling contracts which live outside the /contracts folder but have imports from there fails with:

{ Error: lib/maker/SaiTub.sol:25:1: ParserError: Source "contracts/exchange/ERC20.sol" not found: File import callback not supported
import "../../contracts/exchange/ERC20.sol";
^------------------------------------------^
    at new ExtendableError (/argent-contracts/node_modules/etherlime/cli-commands/compiler/etherlime-error/index.js:7:19)
    at new CompileError (/argent-contracts/node_modules/etherlime/cli-commands/compiler/etherlime-compile/compile-error.js:11:5)
    at Promise (/argent-contracts/node_modules/etherlime/cli-commands/compiler/etherlime-compile/index.js:81:18)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
    at Function.Module.runMain (module.js:696:11)
    at findNodeScript.then.existing (/Users/Elena/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/libnpx/index.js:268:14)
    at <anonymous>
  message: 'lib/maker/SaiTub.sol:25:1: ParserError: Source "contracts/exchange/ERC20.sol" not found: File import callback not supported\nimport "../../contracts/exchange/ERC20.sol";\n^------------------------------------------^\n\u001b[31mCompilation failed. See above.\u001b[39m',
  stack: 'Error: lib/maker/SaiTub.sol:25:1: ParserError: Source "contracts/exchange/ERC20.sol" not found: File import callback not supported\nimport "../../contracts/exchange/ERC20.sol";\n^------------------------------------------^\n    at new ExtendableError (/argent-contracts/node_modules/etherlime/cli-commands/compiler/etherlime-error/index.js:7:19)\n    at new CompileError (/argent-contracts/node_modules/etherlime/cli-commands/compiler/etherlime-compile/compile-error.js:11:5)\n    at Promise (/argent-contracts/node_modules/etherlime/cli-commands/compiler/etherlime-compile/index.js:81:18)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:189:7)\n    at Function.Module.runMain (module.js:696:11)\n    at findNodeScript.then.existing (/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/libnpx/index.js:268:14)\n    at <anonymous>',
  name: 'CompileError' }

You can reproduce with the following file system setup:
/contracts
/tokens
ERC20.sol
/lib
TestContract.sol

where TestContract imports ../contracts/tokens/ERC20.sol

@elenadimitrova
The issue is fixed and a new version is released -> etherlime@2.3.1