Import problem with web3.eth.compile.solidity

atiwariatiwari Member Posts: 3

Hi All,

I have 3 contracts A, B and C (as below) in its respective files (eg. A.sol, B.sol and C.sol) and all are in some folder.

contract A {…..}

import “A"
contract B {…...}

import “A”
import “B"
contract C {…...}

I have 3 node scripts (a.js, b.js and c.js) to compile each contracts. I am reading the source file in the script and using web3.eth.compile.solidity to compile the contracts.

My problem:

When I run a.js and b.js everything works perfect when I run c.js I am getting following error

throw errors.InvalidResponse(result);

Error: solc: exit status 1
:1:1: Error: Source not found: File not found.
import “B";

at Object.module.exports.InvalidResponse (/Users/arvtiwar/node_modules/web3/lib/web3/errors.js:35:16)
at RequestManager.send (/Users/arvtiwar/node_modules/web3/lib/web3/requestmanager.js:61:22)
at Object.send [as solidity] (/Users/arvtiwar/node_modules/web3/lib/web3/method.js:145:58)
at Object. (/Users/arvtiwar/ccsdev/projects/ethereum/test/C_Create.js:19:39)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
at startup (node.js:136:18)

Note: When I use truffle to compile, it compiles without error.

I am out of ideas, please let me know if more info is needed.

Thanks in advance


Sign In or Register to comment.