Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Compile error #49

Closed
m888m opened this issue Nov 2, 2015 · 5 comments
Closed

Compile error #49

m888m opened this issue Nov 2, 2015 · 5 comments

Comments

@m888m
Copy link

m888m commented Nov 2, 2015

When I try to compile contracts, I get the following strange error:

m@888@m:~/dmc/truffleTest$ truffle compile
Compiling ./contracts/HDC.sol...
/home/m/npm-global/lib/node_modules/truffle/node_modules/solc/bin/soljson-latest.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["r

TypeError: Cannot read property 'bytecode' of undefined
  at /home/m/npm-global/lib/node_modules/truffle/lib/contracts.es6:171:45
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:356:13
  at iterate (/home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:262:13)
  at async.forEachOfSeries.async.eachOfSeries (/home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:281:9)
  at _asyncMap (/home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:355:9)
  at Object.mapSeries (/home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:347:20)
  at Object.compile_all (/home/m/npm-global/lib/node_modules/truffle/lib/contracts.es6:144:11)
  at /home/m/npm-global/lib/node_modules/truffle/lib/contracts.es6:210:14
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:713:13
  at iterate (/home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:262:13)
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:274:29
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:44:16
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:718:17
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/async/lib/async.js:167:37
  at /home/m/npm-global/lib/node_modules/truffle/lib/contracts.es6:206:11
  at /home/m/npm-global/lib/node_modules/truffle/lib/config.es6:220:9
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/web3/lib/web3/property.js:118:13
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/web3/lib/web3/requestmanager.js:89:9
  at [object Object].request.onreadystatechange (/home/m/npm-global/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:114:13)
  at [object Object].dispatchEvent (/home/m/npm-global/lib/node_modules/truffle/node_modules/web3/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
  at setState (/home/m/npm-global/lib/node_modules/truffle/node_modules/web3/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
  at IncomingMessage.<anonymous> (/home/m/npm-global/lib/node_modules/truffle/node_modules/web3/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)
  at emitNone (events.js:72:20)
  at IncomingMessage.emit (events.js:166:7)
  at endReadableNT (_stream_readable.js:903:12)
  at doNTCallback2 (node.js:439:9)
  at process._tickDomainCallback (node.js:394:17)
  at Function.module.exports.loopWhile (/home/m/npm-global/lib/node_modules/truffle/node_modules/deasync/index.js:64:21)
  at /home/m/npm-global/lib/node_modules/truffle/node_modules/deasync/index.js:36:18
  at runTask (/home/m/npm-global/lib/node_modules/truffle/truffle.es6:55:5)
  at Object.<anonymous> (/home/m/npm-global/lib/node_modules/truffle/truffle.es6:347:14)
  at Module._compile (module.js:435:26)
  at normalLoader (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:199:5)
  at Object.require.extensions.(anonymous function) [as .es6] (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/node_modules/babel-core/lib/api/register/node.js:216:7)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Function.Module.runMain (module.js:467:10)
  at Object.<anonymous> (/home/m/npm-global/lib/node_modules/truffle/node_modules/babel/lib/_babel-node.js:144:25)
  at Module._compile (module.js:435:26)
  at Object.Module._extensions..js (module.js:442:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Function.Module.runMain (module.js:467:10)
  at startup (node.js:134:18)
  at node.js:961:3

Please help 👍

@m888m
Copy link
Author

m888m commented Nov 4, 2015

Could you give me some help with this issue please. Thanks :)

@tcoulter
Copy link
Contributor

tcoulter commented Nov 4, 2015

Hi there. Can you please paste the code of HDC.sol?

On Wednesday, November 4, 2015, m888m [email protected] wrote:

Could you give me some help with this issue please. Thanks :)


Reply to this email directly or view it on GitHub
#49 (comment).

@m888m
Copy link
Author

m888m commented Nov 5, 2015

Hi Tim, your intuition was right -- it was a compatibility issue of my contract and the newest solc version.
It had compiled fine in a previous version, but there have been some changes to solidity which broke things.
I checked the contract, and upgraded the syntax, so now things work fine.

I have a suggestion though: can you catch this kind of errors in truffle, and point users to the solution?
Thanks a lot 👍

@adridadou
Copy link

Hi, I have the same issue, could tell me which change did you have to make ? thanks!

@tcoulter
Copy link
Contributor

Hi there. This is a super old issue (I apologize) that has likely been fixed in further releases of Truffle or the most recent release of Truffle 2.0. I'm going to close this for housekeeping purposes. However, don't hesitate to check out the Truffle Gitter for more help, or file a new issue if you run into trouble. Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants