Breaking on External Call

35 views Asked by At

I'm able to break on requests in NodeJS. However, when I try to set a breakpoint in a callback function (which makes an external request), it fails to break.

Is there some option I need to set to make this work? Or, is there another approach that I need to take?

app.use('/feed', function(req, res, next){

    instagram.set('client_id', 'id'); /* can break here */
    instagram.set('client_secret', 'secret'); /* and can break here */

    instagram.tags.info({
      name: 'tagone,tagtwo',
      complete: function(data){
            console.log(data); /* trying to break here ... */
        }
    });
});

FWIW, I'm using node-inspector and instagram-node-lib.

1

There are 1 answers

1
Brasilikum On BEST ANSWER

You need no extra Tool. The Complete callback is never executed if your debugger does not stop there. To prove it, write something static like

console.log('invisible') 

to the console in the callback and execute without debugger. It should not print anything to the console