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

Compile error causes to misleading error #117

Closed
kumavis opened this issue Mar 23, 2016 · 5 comments
Closed

Compile error causes to misleading error #117

kumavis opened this issue Mar 23, 2016 · 5 comments

Comments

@kumavis
Copy link
Contributor

kumavis commented Mar 23, 2016

╭─kumavis@xyzs-MacBook-Pro  ~/dev/wx-demo   
╰─$ truffle test 
Using environment test.
Compiling contracts...
TypeError: Cannot read property 'bytecode' of undefined
  at /Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/lib/contracts.es6:171:45
  at /Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/async/lib/async.js:356:13
  at iterate (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/async/lib/async.js:262:13)
  at async.forEachOfSeries.async.eachOfSeries (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/async/lib/async.js:281:9)
  at _asyncMap (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/async/lib/async.js:355:9)
  at Object.mapSeries (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/async/lib/async.js:347:20)
  at Object.compile_all (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/lib/contracts.es6:144:11)
  at /Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/lib/test.es6:359:19
  at tryCatcher (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/util.js:26:23)
  at Promise._resolveFromResolver (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/promise.js:480:31)
  at new Promise (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/promise.js:70:37)
  at /Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/lib/test.es6:347:14
  at tryCatcher (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/util.js:26:23)
  at Promise._settlePromiseFromHandler (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/promise.js:507:31)
  at Promise._settlePromiseAt (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/promise.js:581:18)
  at Promise._settlePromises (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/promise.js:697:14)
  at Async._drainQueue (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/async.js:123:16)
  at Async._drainQueues (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/async.js:133:10)
  at Immediate.Async.drainQueues [as _onImmediate] (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/bluebird/js/main/async.js:15:14)
  at processImmediate [as _immediateCallback] (timers.js:383:17)
  at Function.module.exports.loopWhile (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/deasync/index.js:64:21)
  at /Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/deasync/index.js:36:18
  at runTask (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/truffle.es6:55:5)
  at Object.<anonymous> (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/truffle.es6:362:14)
  at Module._compile (module.js:435:26)
  at normalLoader (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/node_modules/babel-core/lib/api/register/node.js:199:5)
  at Object.require.extensions.(anonymous function) [as .es6] (/Users/kumavis/.nvm/versions/node/v4.2.3/lib/node_modules/truffle/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> (/Users/kumavis/.nvm/versions/node/v4.2.3/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:136:18)
  at node.js:963:3
@kumavis kumavis changed the title error on "truffle test" - Cannot read property 'bytecode' of undefined Compile error causes to misleading error Mar 23, 2016
@kumavis
Copy link
Contributor Author

kumavis commented Mar 23, 2016

we should check for the byte code and if possible display the original error

@kumavis
Copy link
Contributor Author

kumavis commented Mar 23, 2016

#49 relevant

@tcoulter
Copy link
Contributor

This is due to your contract's name not matching your contract's filename. Please see this page under the heading "Convention": http://truffle.readthedocs.org/en/latest/getting_started/compile/

This has already been fixed on master.

@kumavis
Copy link
Contributor Author

kumavis commented Mar 23, 2016

they do match, but glad its fixed.. on master now and its working

@tcoulter
Copy link
Contributor

You'll have to show me the code then - hard to debug otherwise. Related tickets: #113, #89, #60, #39

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

2 participants