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

Navigating a project's contracts directory with Finder on OSX creates a .DS_Store file which truffle tries to compile, resulting in an error. #51

Closed
ramvi opened this issue Nov 3, 2015 · 4 comments
Labels

Comments

@ramvi
Copy link

ramvi commented Nov 3, 2015

$ truffle deploy
Using environment development.
Compiling ./contracts/.DS_Store...
/usr/local/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["readFileS

TypeError: Cannot read property 'bytecode' of undefined
  at /usr/local/lib/node_modules/truffle/lib/contracts.es6:171:45
  at /usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:356:13
  at iterate (/usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:262:13)
  at async.forEachOfSeries.async.eachOfSeries (/usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:281:9)
  at _asyncMap (/usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:355:9)
  at Object.mapSeries (/usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:347:20)
  at Object.compile_all (/usr/local/lib/node_modules/truffle/lib/contracts.es6:144:11)
  at /usr/local/lib/node_modules/truffle/lib/contracts.es6:230:16
  at /usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:713:13
  at iterate (/usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:262:13)
  at /usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:274:29
  at /usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:44:16
  at /usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:718:17
  at /usr/local/lib/node_modules/truffle/node_modules/async/lib/async.js:167:37
  at /usr/local/lib/node_modules/truffle/lib/contracts.es6:226:9
  at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/property.js:118:13
  at /usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/requestmanager.js:89:9
  at [object Object].request.onreadystatechange (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:114:13)
  at [object Object].dispatchEvent (/usr/local/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
  at setState (/usr/local/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
  at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/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:905:12)
  at doNTCallback2 (node.js:450:9)
  at process._tickDomainCallback (node.js:405:17)
  at Function.module.exports.loopWhile (/usr/local/lib/node_modules/truffle/node_modules/deasync/index.js:64:21)
  at /usr/local/lib/node_modules/truffle/node_modules/deasync/index.js:36:18
  at runTask (/usr/local/lib/node_modules/truffle/truffle.es6:55:5)
  at Object.<anonymous> (/usr/local/lib/node_modules/truffle/truffle.es6:347:14)
  at Module._compile (module.js:425:26)
  at normalLoader (/usr/local/lib/node_modules/truffle/node_modules/babel-core/lib/api/register/node.js:199:5)
  at Object.require.extensions.(anonymous function) [as .es6] (/usr/local/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:457:10)
  at Object.<anonymous> (/usr/local/lib/node_modules/truffle/node_modules/babel/lib/_babel-node.js:144:25)
  at Module._compile (module.js:425:26)
  at Object.Module._extensions..js (module.js:432:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:311:12)
  at Function.Module.runMain (module.js:457:10)
  at startup (node.js:136:18)
  at node.js:972:3

A check (no hidden files?) should be added to lib/contracts.es6 line 122.

@tom-seddon
Copy link

This also happens with temporary emacs files. Skipping hidden files (hidden by the Unix-style rules, that is - i.e., name starts with .) would fix this too.

--Tom

@JackPickering
Copy link

Go to the directory you wish to check i.e. ./contracts/ in the command line

Run ls -la - this will list all files (including hidden ones)

Then run rm .DS_Store which will remove any such files

@JackPickering
Copy link

Its likely that DS_Store will have copied into various directories as well so go through and check each one using ls -la.

@cgewecke
Copy link
Contributor

Closing in favor of #684, which is more recent (Nov 15, 2017) and refers to version 3.4.11.

nakajo2011 pushed a commit to nakajo2011/truffle that referenced this issue Aug 7, 2018
benjamincburns pushed a commit that referenced this issue Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants