Knex doesn't work on Workers

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 does a require('pg');. Moreover, their Client class uses EventEmitter, but I am using compatibility_flags = ["nodejs_compat"] What could the issue be? I saw an article saying there's support for knex.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?