Truffle: File import callback not supported

Created on 12 May 2017  路  6Comments  路  Source: trufflesuite/truffle

  • [x] I've asked for help in the Truffle Gitter before filing this issue.

Issue

truffle migrate produces following output

PS C:\Projects\CTBaas\init> truffle migrate
Compiling .\contracts\ConvertLib.sol...
Compiling .\contracts\MetaCoin.sol...
Compiling .\contracts\Migrations.sol...

C:\Projects\CTBaas\init\contracts\MetaCoin.sol:3:1: : Source "ConvertLib.sol" not found: File import callback not supported
import "./ConvertLib.sol";
^------------------------^
Compilation failed. See above.

Steps to Reproduce

  1. run testrpc
  2. run truffle migrate

Expected Behavior

sol contracts are compiled and loaded to the testrpc

Actual Results

PS C:\Projects\CTBaas\init> truffle migrate
Compiling .\contracts\ConvertLib.sol...
Compiling .\contracts\MetaCoin.sol...
Compiling .\contracts\Migrations.sol...

C:\Projects\CTBaas\init\contracts\MetaCoin.sol:3:1: : Source "ConvertLib.sol" not found: File import callback not supported
import "./ConvertLib.sol";

Environment

  • OS: Windows 10 /PowerShell 5.1
  • Truffle version: Truffle v3.2.2
  • Ethereum client: name: 'ethereumjs-testrpc',
    description: 'npm npm',
    'dist-tags': { latest: '3.0.5', beta: '3.9.0' },

  • node version: v7.10.0

  • npm version: 4.5.0

Most helpful comment

or in VS Code settings

"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.packageDefaultDependenciesDirectory": "node_modules"

All 6 comments

I think this issue and https://github.com/trufflesuite/truffle/issues/400 are the same.

Yep, this is a dupe of #400. Just fixed #400 (again). Closing this one in favor of that one.

I just change to
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
it done.

or in VS Code settings

"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.packageDefaultDependenciesDirectory": "node_modules"

thx

@niuwenchen it worked , thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oed picture oed  路  3Comments

hefgi picture hefgi  路  3Comments

ferittuncer picture ferittuncer  路  3Comments

ripper234 picture ripper234  路  4Comments

rotcivegaf picture rotcivegaf  路  3Comments