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💯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.
Was this page helpful?