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: Q.nextTick.runAfter is not a function

See original GitHub issue
var answer = q.defer();
var replyQueue;
function MaybeAnswer(msg) {
       answer.reject(new Error(msg.content.toString()));

return ch.assertQueue(toQueue, queueOptions || this.queueOptions)
                            .then(function () {
                                return ch.assertQueue('', this.replyQueueOptions);
                            .then(function assertQueueSuccess(qok) {
                                replyQueue = qok.queue;
                                return ch.consume(replyQueue, MaybeAnswer.bind(this), {noAck: true});
                            .then(function consumeSuccess() {
                                ch.sendToQueue(toQueue || this.queue, new Buffer(msg), props);
                                return answer.promise;
                            .catch(function (error) {
                                // Return Error to the outer .catch()
                                return q.reject(error);
                            .finally(function () {
                                if (this.standalone) {
                                else {

While running above code I’m getting an error

TypeError: Q.nextTick.runAfter is not a function

stack trace: at trackRejection (/Volumes/DATA/projects/cirrent/api-dev/node_modules/q/q.js:1059:20) at reject (/Volumes/DATA/projects/cirrent/api-dev/node_modules/q/q.js:1133:5) at deferred.reject (/Volumes/DATA/projects/cirrent/api-dev/node_modules/q/q.js:634:16) at Object.MaybeAnswer (/Volumes/DATA/projects/cirrent/api-dev/node_modules/API-Common/helpers/rpc.js:98:44) at Channel.BaseChannel.dispatchMessage (/Volumes/DATA/projects/cirrent/api-dev/node_modules/amqplib/lib/channel.js:466:12) at Channel.BaseChannel.handleDelivery (/Volumes/DATA/projects/cirrent/api-dev/node_modules/amqplib/lib/channel.js:475:15) at emitOne (events.js:77:13) at Channel.emit (events.js:169:7) at /Volumes/DATA/projects/cirrent/api-dev/node_modules/amqplib/lib/channel.js:263:10 at Channel.content as handleMessage

I really couldn’t find out what’s gone wrong with my code. I’d appreciate if anyone can help with this.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

benjamingrcommented, May 20, 2016

As the person who suggested the scheduler APi for bluebird I’ll gladly implement an API for Q for the same thing if Kris asks.

landonpochcommented, Dec 15, 2016

@zamb3zi , Attempting your workaround, runAfter comes back as undefined when destructuring nextTick after reassignment. I’m using q@1.4.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js "TypeError: process.nextTick is not a function"?
All these code is working except getting the process.nextTick's TypeError every few hours, unsure which part caused the error...or can the error ...
Read more >
Node.js v19.3.0 Documentation
Functions to convert from C types to Node-API ... nextTick(). events. ... WARNING: This does not throw an AssertionError in legacy assertion mode!...
Read more >
failed to instantiate module ngsanitize due to: typeerror ...
TypeError: Q.nextTick.runAfter is not a function #764. Open nandreev211 opened this issue Feb 18, TypeError: Q.nextTick.runAfter is not a function.
Read more >
api documentation for q (v1.5.0)
nextTick (task); function q.resolve.nfapply (callback, args); function q.resolve.nfbind ... that indicates that the promise has not yet // been resolved.
Read more >
q.js | searchcode
Q = definition(); 67 68 // Add a noConflict function so Q can be removed from ... 518Q.nextTick = nextTick; 519 520/** 521...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found