Question

During heroku deployment, I see NPM running, then bower running - all of this happens immediately, and appears to work. Then I get to brunch build (--production) - and all hell breaks loose - gist

It may be entirely possible that in my plethora of debugging, I have no killed something in my configurations, however, the error is reproduced on my local machine during the build.

I apologize in advanced for the length here - but I'm at my last life and need some help. Why does it fail? Is it a brunch bug still? Versioning issues? Am I dumb and missed something?

package.json

{
  "author": "Name",
  "name": "MyApp",
  "description": "App description",
  "version": "0.0.0",
  "homepage": "",
  "repository": {
    "type": "git",
    "url": ""
  },
  "engines": {
    "node": "~0.11.9"
  },
  "scripts": {
    "install": "./node_modules/bower/bin/bower install",
    "postinstall": "./node_modules/brunch/bin/brunch build",
    "start" : "node app.js"
  },
  "dependencies": {
    "brunch" : "*",
    "javascript-brunch": "*",
    "css-brunch": "*",
    "uglify-js-brunch": "*",
    "clean-css-brunch": "*",
    "auto-reload-brunch": "*",
    "express": "*",
    "twilio" : "*",
    "request" : "*",
    "read-components" : "*",
    "bower" : "*"
   },
  "devDependencies": {
  }
}

config.js

exports.config = {
  files: {
    javascripts: {
      joinTo: 'js/app.js'
    },
    stylesheets: {
      joinTo: 'css/app.css'
    },
    templates: {
      precompile : false,
      defaultExtension : 'hbs',
      root :'templates',
      joinTo: 'js/app.js'
    }
  },
  server: {
    path: 'app.js',
    port: 3333,
    base: '/',
    run: 'yes'
  }
};

bower.json

{
  "name": "test",
  "version": "0.1",
  "dependencies": {
    "jquery" : "~2.0",
    "bootstrap": "~3.0",
    "highcharts" : "latest",
    "firebase" : "latest"
  },
  "overrides": {
    "highcharts": {
      "main": "highcharts-all.js"
    }
  }
}

app.js

var express = require('express'),
    app = express(),
    vote = require('./routes/vote');


app.use(express["static"](__dirname + '/dist'));
app.use(express.urlencoded());

app.get('/', function(req, res) {
return res.sendfile('./dist/index.html');
});

app.post('/vote', vote.addNew);

exports.startServer = function(port, path, callback) {
  var p;
  p = process.env.PORT || port;
  console.log("startServer on port: " + p + ", path " + path);
  return app.listen(p);
};
Était-ce utile?

La solution

Heroku apparently throws stuff in vendor directory which isn't right. Try ignoring it in config:

config = paths: watched: ['app']

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top