Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot call method 'forEach' of undefined #56

Open
matissse opened this issue Oct 18, 2016 · 3 comments
Open

TypeError: Cannot call method 'forEach' of undefined #56

matissse opened this issue Oct 18, 2016 · 3 comments

Comments

@matissse
Copy link

Hello, i tried to start node but got error:

/var/www/html/calendar/node_modules/jugglingdb-postgres/lib/postgres.js:419
        data.forEach(function(field){
             ^
TypeError: Cannot call method 'forEach' of undefined
    at decoratedCallback (/var/www/html/calendar/node_modules/jugglingdb-postgres/lib/postgres.js:419:14)
    at /var/www/html/calendar/node_modules/jugglingdb-postgres/lib/postgres.js:64:20
    at /var/www/html/calendar/node_modules/jugglingdb-postgres/node_modules/pg/lib/pool.js:75:25
    at /var/www/html/calendar/node_modules/jugglingdb-postgres/node_modules/generic-pool/lib/generic-pool.js:274:11
    at /var/www/html/calendar/node_modules/jugglingdb-postgres/node_modules/pg/lib/pool.js:27:26
    at null.<anonymous> (/var/www/html/calendar/node_modules/jugglingdb-postgres/node_modules/pg/lib/client.js:181:5)
    at emit (events.js:95:17)
    at Socket.<anonymous> (/var/www/html/calendar/node_modules/jugglingdb-postgres/node_modules/pg/lib/connection.js:109:12)
    at Socket.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:765:14)
    at Socket.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:427:10)
    at emitReadable (_stream_readable.js:423:5)
    at readableAddChunk (_stream_readable.js:166:9)
    at Socket.Readable.push (_stream_readable.js:128:10)
    at TCP.onread (net.js:529:21)

I think trouble to connect database?

"store": {
      // You won't want to use the memory store in production, or your install
      // registrations will be forgotten any time your app restarts.  Here
      // we tell atlassian-connect-express to use the PostgreSQL backend for the default
      // JugglingDB adapter.
      "type": "postgres",
      // Again, a PaaS host like Heroku will probably provide the db connection
      // URL to you through the environment, so we tell atlassian-connect-express to use that value.
      "url": "postgres://localhost:5432/nodejs_calendar"
    },

I use node version 0.10.42 on Centos 6 64bit.
Linux CentOS-68-64-minimal 2.6.32-642.6.1.el6.x86_64 #1 SMP Wed Oct 5 00:36:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
And when i do npm install i haven't got any errors.
Thanks!

@dfischer0
Copy link

I'm running into the exact same issue, but it seems to work if I downgrade Node JS to the latest 5.x version (5.12.0).
I'm afraid it might be an issue with the pg module used within jugglingdb-postgres.

Anybody looking into this?

@avalez
Copy link

avalez commented Dec 8, 2016

The following worked for me:

heroku config:set PGSSLMODE=require

See also brianc/node-postgres#553

@richardsimko
Copy link

richardsimko commented Mar 27, 2017

This project is no longer maintained and has been dead for a while so I would advise anyone who has the choice to steer clear of anything jugglingdb related (Even the original author recommends against using it in 1602/jugglingdb#453). I reported this 6+ months ago in #55 and since then nothing has happened.

The solution suggested @avalez solved my issue on Heroku as well however.

EDIT: Actually it only works if I install the dependency directly from Git, since the underlying issue comes from the old version of pg not being compatible with node 6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants