Can't get production confluence-cloud app working on Heroku

I am running into issues though with the app running on production:
What should a proper package.json look like? Here is mine:

{
  "name": "confluence-owlorbit-addon",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "async": "2.0.1",
    "atlassian-connect-express": "2.1.3",
    "body-parser": "^1.14.2",
    "compression": "^1.6.0",
    "cookie-parser": "^1.4.0",
    "errorhandler": "^1.4.2",
    "express": "^4.13.3",
    "express-hbs": "*",
    "morgan": "^1.6.1",
    "request-promise" : "4.2.2",
    "sqlite3": "^3.1.13",
    "static-expiry": ">=0.0.5",
    "urijs": "1.18.1"
  }
}

And here is what the error on the server says…

2018-04-04T11:31:41.052275+00:00 heroku[web.1]: Starting process with command `node app.js`
2018-04-04T11:31:44.353034+00:00 app[web.1]: 
2018-04-04T11:31:44.353061+00:00 app[web.1]: WARNING: JugglingDB adapter "postgres" is not installed,
2018-04-04T11:31:44.353063+00:00 app[web.1]: so your models would not work, to fix run:
2018-04-04T11:31:44.353064+00:00 app[web.1]: 
2018-04-04T11:31:44.353066+00:00 app[web.1]:     npm install jugglingdb-postgres 
2018-04-04T11:31:44.353067+00:00 app[web.1]: 
2018-04-04T11:31:44.682152+00:00 app[web.1]: Add-on server running at http://2c914e9b-0b72-4977-b7f1-b569fb7c5758:10989
2018-04-04T11:31:44.684685+00:00 app[web.1]: Unhandled error: TypeError: Cannot read property 'define' of undefined
2018-04-04T11:31:44.684689+00:00 app[web.1]:     at Schema.defineClass [as define] (/app/node_modules/jugglingdb/lib/schema.js:250:17)
2018-04-04T11:31:44.684691+00:00 app[web.1]:     at Schema.extend (/app/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:14:20)
2018-04-04T11:31:44.684693+00:00 app[web.1]:     at /app/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:35:12
2018-04-04T11:31:44.684694+00:00 app[web.1]:     at lib$rsvp$$internal$$initializePromise (/app/node_modules/rsvp/dist/rsvp.js:1084:9)
2018-04-04T11:31:44.684696+00:00 app[web.1]:     at new lib$rsvp$promise$$Promise (/app/node_modules/rsvp/dist/rsvp.js:546:53)
2018-04-04T11:31:44.684697+00:00 app[web.1]:     at new JugglingDB (/app/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:32:18)
2018-04-04T11:31:44.684699+00:00 app[web.1]:     at module.exports (/app/node_modules/atlassian-connect-express/lib/store/jugglingdb.js:168:10)
2018-04-04T11:31:44.684700+00:00 app[web.1]:     at Function.stores.create (/app/node_modules/atlassian-connect-express/lib/store/index.js:18:10)
2018-04-04T11:31:44.684702+00:00 app[web.1]:     at stores (/app/node_modules/atlassian-connect-express/lib/store/index.js:12:17)
2018-04-04T11:31:44.684703+00:00 app[web.1]:     at EventEmitter.Addon (/app/node_modules/atlassian-connect-express/lib/index.js:35:38)
2018-04-04T11:31:44.684705+00:00 app[web.1]:     at module.exports (/app/node_modules/atlassian-connect-express/lib/index.js:209:12)
2018-04-04T11:31:44.684707+00:00 app[web.1]:     at Object.<anonymous> (/app/app.js:35:13)
2018-04-04T11:31:44.684708+00:00 app[web.1]:     at Module._compile (module.js:413:34)
2018-04-04T11:31:44.684710+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:422:10)
2018-04-04T11:31:44.684712+00:00 app[web.1]:     at Module.load (module.js:357:32)
2018-04-04T11:31:44.684713+00:00 app[web.1]:     at Function.Module._load (module.js:314:12)

I’ve tried adding these to the package.json but it just times out on the main macro url:

    "jugglingdb": "0.2.x",    
    "jugglingdb-postgres": "latest",    
    "jugglingdb-sqlite3": "0.0.5",

hi @tim.nguyen,

Quick question: can you get your app to run locally?
Or do you also get this error?

What do you mean with “it times out on the main macro url” ?

I am able to run it fine locally. It times out in production when I visit the default url route of the macro.

Might it be a Heroku problem then?
Maybe it’s trying to get something that it can’t reach?

Just wondering.

What version of node is installed on Heroku?

It is running node.js version:
v8.11.1

I am following this tutorial to no avail:

Is anyone else able to successfully deploy a private app via heroku with those steps?

So it appears the culprit is this line where it authenticates…:

app.get('/v1/my_macro', addon.authenticate(), function (req, res) {

As soon as I remove addon.authenticate() it is able to load fine… but defeats the purpose of this being protected by atlassian’s directory. Anybody have any ideas on why doing that addon.authenticate() times out in production?