slashdotdash / node-ledger-web

Web front-end to access ledger cli data.
MIT License
144 stars 14 forks source link

Cannot access any screen - 'Can't set headers after they are sent.' #2

Open amalbuquerque opened 9 years ago

amalbuquerque commented 9 years ago

After cloning the node-ledger-web and following the available instructions, I can't access anything other than the homepage. The following it's the output of accessing /balance:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/ledger_web$ node app.js
Ledger REST server listening on port 30001
Express server listening on port 3000
GET / 200 45ms - 953b
GET /css/main.css 200 85ms - 120.26kb
GET /css/vendor/nv.d3.css 200 74ms - 10.71kb
GET /js/vendor/require.js 200 80ms - 81.56kb
GET /js/ledger/main.js 200 16ms - 894b
GET /js/ledger/ledger.js 200 42ms - 322b
GET /js/ledger/income/module.js 200 40ms - 685b
GET /js/ledger/spending/module.js 200 36ms - 709b
GET /js/ledger/worth/module.js 200 37ms - 622b
GET /js/ledger/dashboard/module.js 200 60ms - 661b
GET /js/ledger/balance/module.js 200 40ms - 642b
GET /js/ledger/spending/router.js 200 49ms - 204b
GET /js/ledger/spending/controller.js 200 52ms - 1.17kb
GET /js/ledger/income/router.js 200 36ms - 198b
GET /js/ledger/vent.js 200 42ms - 106b
GET /js/ledger/income/controller.js 200 32ms - 1.34kb
GET /js/ledger/controlNavigation.js 200 59ms - 882b
GET /js/ledger/worth/router.js 200 84ms - 199b
GET /js/ledger/worth/controller.js 200 90ms - 1.63kb
GET /js/vendor/underscore.js 200 73ms - 42.55kb
GET /js/ledger/dashboard/router.js 200 91ms - 184b
GET /js/ledger/dashboard/controller.js 200 123ms - 1.66kb
GET /js/vendor/jquery.js 200 182ms - 236.47kb
GET /js/ledger/balance/router.js 200 98ms - 240b
GET /js/ledger/spending/model.js 200 100ms - 1.68kb
GET /js/ledger/balance/controller.js 200 111ms - 1.63kb
GET /js/ledger/spending/expenditure-chart.js 200 112ms - 2.5kb
GET /js/ledger/controls/model.js 200 127ms - 967b
GET /js/ledger/income/income-vs-expenditure-chart.js 200 115ms - 2.37kb
GET /js/ledger/income/model.js 200 137ms - 1.76kb
GET /js/ledger/controls/charting.js 200 167ms - 1.46kb
GET /js/ledger/aggregateCollection.js 200 173ms - 1.23kb
GET /js/ledger/worth/model.js 200 192ms - 1.86kb
GET /js/ledger/worth/net-worth-chart.js 200 192ms - 3.24kb
GET /js/vendor/react.js 200 351ms - 447.98kb
GET /js/ledger/dashboard/model.js 200 165ms - 639b
GET /js/ledger/dashboard/navigation.js 200 174ms - 1.01kb
GET /js/ledger/dashboard/dashboard.js 200 126ms - 1.28kb
GET /js/ledger/dateRange.js 200 97ms - 1.65kb
GET /js/ledger/groupByDate.js 200 107ms - 831b
GET /js/ledger/balance/model.js 200 106ms - 1.33kb
GET /js/ledger/filteredCollection.js 200 78ms - 2kb
GET /js/ledger/balance/chart.js 200 113ms - 1.84kb
GET /js/vendor/backbone.js 200 99ms - 59.57kb
GET /js/ledger/charting/multi-bar-chart.js 200 100ms - 2.08kb
GET /js/ledger/react.backbone.js 200 91ms - 1.66kb
GET /js/ledger/charting/line-plus-bar-chart.js 200 32ms - 2.09kb
GET /js/ledger/singleActiveItem.js 200 49ms - 435b
GET /js/ledger/charting/pie-chart.js 200 44ms - 1.38kb
GET /js/vendor/backbone.marionette.js 200 53ms - 69.77kb
GET /js/vendor/d3.js 200 100ms - 318.15kb
GET /js/vendor/nv.d3.js 200 74ms - 450.47kb

http.js:690
    throw new Error('Can\'t set headers after they are sent.');
          ^
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:690:11)
    at ServerResponse.res.setHeader (/vagrant/ledger_web/node_modules/express/node_modules/connect/lib/patch.js:63:22)
    at ServerResponse.format (/vagrant/ledger_web/node_modules/ledger-rest/node_modules/restify/lib/response.js:98:10)
    at ServerResponse.send (/vagrant/ledger_web/node_modules/ledger-rest/node_modules/restify/lib/response.js:208:24)
    at Server.<anonymous> (/vagrant/ledger_web/node_modules/ledger-rest/node_modules/restify/lib/index.js:87:13)
    at Server.emit (events.js:106:17)
    at Domain.onError (/vagrant/ledger_web/node_modules/ledger-rest/node_modules/restify/lib/server.js:776:18)
    at Domain.emit (events.js:95:17)
    at process._fatalException (node.js:255:29)
    at process._fatalException (node.js:288:32)
vagrant@vagrant-ubuntu-trusty-64:/vagrant/ledger_web$

Is there any step missing on the provided instructions? Thanks in advance.

slashdotdash commented 9 years ago

@lejboua can you try running the server in non-production mode, see if that works for you?

node app.js

It looks like there's an issue with the RequireJS optimisation of the JavaScript.

amalbuquerque commented 9 years ago

Hi. I tried both ways without success. I'm running inside a clean Vagrant box with Ubuntu 14.04.

On Sun, Mar 15, 2015, 13:18 Ben Smith notifications@github.com wrote:

@lejboua https://github.com/lejboua can you try running the server in non-production mode, see if that works for you?

node app.js

It looks like there's an issue with the RequireJS optimisation of the JavaScript.

— Reply to this email directly or view it on GitHub https://github.com/slashdotdash/node-ledger-web/issues/2#issuecomment-81005171 .

nbegley commented 9 years ago

+1

I'm seeing this bug as well, with or without production mode.

nbegley commented 8 years ago

It looks like this is no longer an issue if you run without production mode.