TypeError: Cannot read property 'callback' of undefined
See original GitHub issueThere has same error : https://github.com/NodeRedis/node_redis/issues/1037 But I don’t know how to solve it. @alexkwolfe @folletto @frosty @markryall I have a clean code by this error before code ,there has
"redis": "^2.6.3",
"kue": "^0.11.5"
follow code in TaskHandler.js
const redis = require('redis')
, kue = require('kue')
, jobs = kue.createQueue()
, SyncData = require('./SyncDataByGet.js')
, debug = require('debug')('TaskExecutor.js');
exports = module.exports = function () {
jobs.process("sysTask", 3, function (job, done) {
try {
let sysTask = job.data;
debug(sysTask);
SyncData.task(sysTask["device_ip"], sysTask['start_time'], sysTask['end_time']).then(function (result) {
job.progress(100, 100, "OK");
done();
}).catch(function (err) {
debug(err);
});
} catch (error) {
}
});
};
then ,I use it by this code
require('TaskHandler')();
then,there has error :
/home/***/DEV/NodeProject/people_counting_statistics/node_modules/redis/index.js:710
if (typeof command_obj.callback === 'function') {
^
TypeError: Cannot read property 'callback' of undefined
at normal_reply (/home/***/DEV/NodeProject/people_counting_statistics/node_modules/redis/index.js:710:27)
at RedisClient.return_reply (/home/***/DEV/NodeProject/people_counting_statistics/node_modules/redis/index.js:816:9)
at JavascriptRedisParser.returnReply (/home/***/DEV/NodeProject/people_counting_statistics/node_modules/redis/index.js:188:18)
at JavascriptRedisParser.execute (/home/***/DEV/NodeProject/people_counting_statistics/node_modules/redis-parser/lib/parser.js:491:12)
at Socket.<anonymous> (/home/***/DEV/NodeProject/people_counting_statistics/node_modules/redis/index.js:267:27)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:551:20)
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
TypeError: Cannot read property 'callback' of undefined #1427
This indicates that the state is not correct anymore. Is there any way you are able to reliable trigger this error and do...
Read more >Cannot read property of undefined issue on callback [duplicate]
I have a very simple class that is wrapping a node.js serial port class. On object creation, a new logger is created. When...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >TypeError: Cannot read property 'callback' of undefined
my code const providerWs = new ethers.providers.WebSocketProvider('quicknode wss provider'); providerWs.on('pending', async (txHash) ...
Read more >Getting "Cannot read property '0' of undefined" exception ...
I am having the exception “Cannot read property '0' of undefined” while using Custom Database Create Action Script.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I find it is Redis Error.KUE with Redis is OK.so Ii go to here NodeRedis/node_redis#1037
@behrad