voxpelli/node-connect-pg-simple

Node v14 not supported

vitaly-t opened this issue ยท 10 comments

To make it work right under Node v14, you need to update pg dependency to version 8.0.3, which is where compatibility with Node v14 was fixed.

Thanks!

Until then, and preferably also after, one can provide a connection pool oneself: https://github.com/voxpelli/node-connect-pg-simple#advanced-options If there's nothing breaking in pg 8.x then it should just work

I tried that but experienced problems...

import session from 'express-session';
import { native as pgNative } from 'pg';
import ConnectPgSimple from 'connect-pg-simple'; // depends on pg < 8.0.3
import config from '../../config/environment';

const pgNativePool = new pgNative.Pool({
  max: 10, // default
  connectionString: config.pg.uri
});

// Persist Express sessions in PostgreSQL
const pgSession = new ConnectPgSimple(session);
const store = new pgSession({
  pgNativePool,
  tableName: 'sessions'
});

export default {
  store // Hangs in Node 14 without errors (classic pg < 8.0.3 problem)
};

Added this pull request: #174. All tests ran successfully.

Seems ok.

I'll keep this open until I've tested and merged the PR ๐Ÿ™‚

zont commented

We are really looking forward to this fix.

@zont I'll take a look at it now

@nstuyvesant looks like your PR works - many thanks!

For any yarn users looking for a temporary fix:

yarn remove connect-pg-simple
yarn add https://github.com/nstuyvesant/node-connect-pg-simple.git#adcb6c4642db88e6de47e3aea48a71b5ab3569fa

Place where the Node 14 fix was made: brianc/node-postgres#2171

Shipped in 6.2.0