-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Cannot read property 'name' of null #2705
Comments
+1 |
2 tasks
+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi.
We have updated our set up from
nodejs 12.16.1
psql (PostgreSQL) 10.1
pg 7.11.0
to:
nodejs 14.18.1
psql (PostgreSQL) 10.1 (also on 13.1)
pg 8.7.1
After that, when any type error happening on callback function, the following error occurring infinitely :
TypeError: Cannot read property 'name' of null
at Client._handleParseComplete (/Users/amr/workspace/node_modules/pg/lib/client.js:367:26)
at Connection.emit (events.js:314:20)
at /Users/amr/workspace/node_modules/pg/lib/connection.js:114:12
at Parser.parse (/Users/amr/workspace/node_modules/pg-protocol/dist/parser.js:40:17)
at Socket. (/Users/amr/workspace/node_modules/pg-protocol/dist/index.js:11:42)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Before the update, our code had been working properly for several years.
Sample of code that raises the error:
var pg = require('pg');
let newPool = function() {
};
let ExecuteQuery = function(sql, bindVars, callback) {
var pool = newPool();
pool.query(sql, bindVars, (err, result) => {
return callback(err, result);
});
}
ExecuteQuery("select 1 from tableX WHERE id = $1", [1], function(err, res) {
if(err) {
console.error(err);
return;
}
console.log(res.a.b); // whatever TypeError caused by the application
});
Any advice?
The text was updated successfully, but these errors were encountered: