freeCodeCamp / meeting-for-good

A meeting coordination app for your team
https://meeting.freecodecamp.org
BSD 3-Clause "New" or "Revised" License
338 stars 113 forks source link

TypeError: Cannot read property 'total' of undefined #446

Closed ZaynMalloc closed 7 years ago

ZaynMalloc commented 7 years ago

When I run `zach@zach-VirtualBox:~/Documents/Code/meetingorginal/meeting-for-good$ npm run serve

I get this error

Node.js listening on port 8080...'
countParticipants :  TypeError: Cannot read property 'total' of undefined
    at /home/zach/Documents/Code/meetingorginal/meeting-for-good/build/api/stats/stats.controller.js:95:36
From previous event:
    at Promise.wrappedThen [as _then] (/home/zach/Documents/Code/meetingorginal/meeting-for-good/node_modules/opbeat/lib/instrumentation/modules/bluebird.js:73:23)
    at countAll (/home/zach/Documents/Code/meetingorginal/meeting-for-good/build/api/stats/stats.controller.js:112:35)
    at computeStats (/home/zach/Documents/Code/meetingorginal/meeting-for-good/build/api/stats/stats.controller.js:121:3)
    at Object.<anonymous> (/home/zach/Documents/Code/meetingorginal/meeting-for-good/build/app.js:127:25)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3
The manifest has been written to /home/zach/Documents/Code/meetingorginal/meeting-for-good/build/client/manifest.json
jrogatis commented 7 years ago

@anischyros Please address this one ASAP

jrogatis commented 7 years ago

Please @ZaynMalloc Can you provide app, mongo and nodes version ?

ZaynMalloc commented 7 years ago

node 7.10.0 v mongo 3.4.5v

jrogatis commented 7 years ago

@ZaynMalloc Your users and events tables are empty ? If was that maybe is causing the issue. And i ask @anischyros to look at. But mean time you can check the tables ? And one advise, please look for this at package.json "engines": { "node": "^8.0.0", "npm": "^5.0.0" },

So try to use ver 8+

anischyros commented 7 years ago

I think this occurs when the events and users tables have yet to be created. I'll have to take that situation into account.