Using the same config that I'm using in my express module, I can't get Knex (with 'pg') working due to the following error:
TypeError: this.driver.Client is not a constructor at Client_PG._acquireOnlyConnection (file:///.../node_modules/knex/lib/dialects/postgres/index.js:82:24) at Client_PG.acquireRawConnection (file:///.../node_modules/knex/lib/dialects/postgres/index.js:100:17) at create (file:///.../node_modules/knex/lib/client.js:264:39)
TypeError: this.driver.Client is not a constructor at Client_PG._acquireOnlyConnection (file:///.../node_modules/knex/lib/dialects/postgres/index.js:82:24) at Client_PG.acquireRawConnection (file:///.../node_modules/knex/lib/dialects/postgres/index.js:100:17) at create (file:///.../node_modules/knex/lib/client.js:264:39)
Internally,
_acquireOnlyConnection
_acquireOnlyConnection
does a
require('pg');
require('pg');
. Moreover, their Client class uses
EventEmitter
EventEmitter
, but I am using
compatibility_flags = ["nodejs_compat"]
compatibility_flags = ["nodejs_compat"]
What could the issue be? I saw an article saying there's support for knex.