Skip to content

pg-native after update pg@8.15.1 and pg-native@3.4.0: Cannot read properties of null (reading 'Pool') #3431

Closed
@cesco69

Description

@cesco69
{
    "name": "example",
    "version": "1.0.0",
    "main": "index.js",
    "dependencies": {
        "pg": "^8.15.1",
        "pg-native": "^3.4.0"
    },
    "sideEffects": false
}
const pg = require("pg");

const pool = new pg.native.Pool({ host: 'LOCALHOST' })
const result = await pool.query('SELECT 1');
console.log(result)

Error

2025-04-23 12:10:48 TypeError: Cannot read properties of null (reading 'Pool')
2025-04-23 12:10:48     at /opt/test/index.js:9:36
2025-04-23 12:10:48     at Layer.handleRequest (/opt/test/node_modules/router/lib/layer.js:152:17)
2025-04-23 12:10:48     at next (/opt/test/node_modules/router/lib/route.js:157:13)
2025-04-23 12:10:48     at Route.dispatch (/opt/test/node_modules/router/lib/route.js:117:3)
2025-04-23 12:10:48     at handle (/opt/test/node_modules/router/index.js:435:11)
2025-04-23 12:10:48     at Layer.handleRequest (/opt/test/node_modules/router/lib/layer.js:152:17)
2025-04-23 12:10:48     at /opt/test/node_modules/router/index.js:295:15
2025-04-23 12:10:48     at processParams (/opt/test/node_modules/router/index.js:582:12)
2025-04-23 12:10:48     at next (/opt/test/node_modules/router/index.js:291:5)
2025-04-23 12:10:48     at Function.handle (/opt/test/node_modules/router/index.js:186:3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions