1
module.exports = {
build: {
//"index.html":"index.html",
//"app.js": [
//"javascripts/app.js"
//],
//"app.css": [ 
//"stylesheets/app.css"
//],
//"images/": "images/"
},
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    }
  }
};

This is my truffle.js config file(the reason I have commented all those lines is that I have not created them yet.) when I run the truffle build command, I get the following error

Build configuration can no longer be specified as an object. Please see our documentation for an updated list of supported build configurations.

I went through http://truffle.readthedocs.io/en/beta/getting_started/build/ but there it's the same. Version Details- Truffle v3.4.7 (core: 3.4.7) Solidity v0.4.13 (solc-js)

The build proceeds with the new config file according to the Truffle version 3 docs.

var DefaultBuilder = require("truffle-default-builder");
module.exports = {
build: new DefaultBuilder({
"index.html":"index.html",
"app.js":[
"javascripts/app.js"]
}),
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    }
  }
};

But now I am getting a new error

Compiling ./contracts/ConvertLib.sol...
Compiling ./contracts/MetaCoin.sol...
Compiling ./contracts/Migrations.sol...
Writing artifacts to ./build/contracts
Error: Couldn't find file at .//app/index.html. 
    at DefaultBuilder.expect (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:281:17)
    at /home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:179:15
    at /home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:375:13
    at iterate (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:262:13)
    at Object.async.forEachOfSeries.async.eachOfSeries (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:281:9)
    at Object.async.inject.async.foldl.async.reduce (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:374:15)
    at DefaultBuilder.process_files (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:173:9)
    at DefaultBuilder.process_target (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:224:8)
    at /home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:263:10
    at /home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:181:20
    at iterate (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:262:13)
    at Object.async.forEachOfSeries.async.eachOfSeries (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:281:9)
    at Object.async.forEachSeries.async.eachSeries (/home/ankit-x3/TRUFFLE/node_modules/async/lib/async.js:214:22)
    at DefaultBuilder.process_all_targets (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:262:9)
    at DefaultBuilder.build (/home/ankit-x3/TRUFFLE/node_modules/truffle-default-builder/index.js:132:8)
    at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:103776:17.

Problem solved. I missed the app directory needed. Thanks.

2

You are on the old documentation (for truffle v2.x). The new documentation for Truffle v.3.x is here

The migration process between the versions is explained here:

Build Pipeline: No more builder, by default In Truffle 1.0 and 2.0, things were heavily geared toward building web applications, and so Truffle shipped with a default build pipeline that could get your dapp up and running quickly. This build pipeline was magical: It did everything for you, and you didn't have to lift a finger. This was good for some use cases, but it became evidently clear that in any other use case the pipeline was very brittle.

Over the last year, Ethereum-enabled applications have only been growing. What started out as solely a platform for web application, now dapps can be written in native languages and run as standalone applications on mobile and the desktop. Truffle has always intended to support these use cases, and so that's why we removed the default build pipeline from Truffle. You can still write your own custom build pipeline if you'd like to tightly integrate it with Truffle, but by default Truffle will focus on continuing to be the best tool for smart contracts around. We'll let the better build pipelines – like webpack, browserify, Grunt, Metalsmith – do the job of, well, building.

Now, just because the build pipeline has been removed by default doesn't mean you don't have options. At Truffle, we care about your developer experience and so would never leave you hanging. In general there are two options for you to choose from, but for the latter option what you'll do is heavily dependent on which build tool (i.e., webpack) you choose to use. Let's go over the options below.

All of that means that the Truffle config file can't contain a build setup anymore. Just remove the build part:

truffle.js

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8545,
      network_id: "*" // Match any network id
    }
  }
};
  • this doesn't work too. – user2594266 Aug 5 '17 at 10:37
  • Same exception? – Greg Jeanmart Aug 5 '17 at 10:37
  • I don't remember it now. But this got resolved with the following truffle.js file - var DefaultBuilder = require("truffle-default-builder"); module.exports = { build: new DefaultBuilder({ "index.html":"index.html", "app.js":[ "javascripts/app.js"] }), networks: { development: { host: "localhost", port: 8545, network_id: "*" // Match any network id } } }; – user2594266 Aug 5 '17 at 10:41
  • now i am facing a new problem. – user2594266 Aug 5 '17 at 10:41
  • Glad to see it worked. This is strange anyway. It could be interesting to write an issue for further analysis on the Truffle GitHub. For the new problem, please create a new question – Greg Jeanmart Aug 5 '17 at 10:44
0

Rename file truffle.js to truffle-config.js , and run your command again

  • got the same error. – user2594266 Aug 4 '17 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.