question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'callback' of undefined

See original GitHub issue

There 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:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Talbot3commented, Dec 9, 2016

I find it is Redis Error.KUE with Redis is OK.so Ii go to here NodeRedis/node_redis#1037

0reactions
Talbot3commented, Dec 9, 2016
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found