Closed
Description
{
"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
Labels
No labels