You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pg from "pg";
const { Pool } = pg;
export const pool = new Pool({
host: process.env.PGHOST,
user: process.env.PGUSER,
password: process.env.PGPASSWORD,
database: process.env.PGDATABASE,
port: process.env.PGPORT,
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 2000,
})
const sqlQuery = "..."
const sqlParam = [...]
let res = await pool.query(sqlQueryTest, sqlParam);
when executing it throws this exception :
/usr/src/app/node_modules/pg-pool/index.js:218
const client = new this.Client(this.options)
^
TypeError: this.Client is not a constructor
at BoundPool.newClient (/usr/src/app/node_modules/pg-pool/index.js:218:20)
at BoundPool.connect (/usr/src/app/node_modules/pg-pool/index.js:212:10)
at BoundPool.query (/usr/src/app/node_modules/pg-pool/index.js:399:10)
at updatePremiumEndDateForCustomer (file:///usr/src/app/actions.js:40:26)
at startSubscription (file:///usr/src/app/actions.js:9:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v20.9.0
Any Idea ?
The text was updated successfully, but these errors were encountered:
Hello there!
I am stuck for a while on it so...
Here is my code :
when executing it throws this exception :
Any Idea ?
The text was updated successfully, but these errors were encountered: