Skip to Content

Node js app remote debugging in Cloud Foundry

I am trying to debug remotely a simple Node.js app. I have a trial account and a subaccount with API endpoint https://api.cf.eu10.hana.ondemand.com.

Start script uses --inspect option: node --inspect app.js

SSH access enabled on both space and app, also the SSH tunnel successfully opens for the app, and I can open Chrome debugger via "chrome://inspect".

It even stops at caught exceptions in debugger if the corresponding flag is set.

The problem is that none of the break-points working. What do I miss?

Add comment
10|10000 characters needed characters exceeded

  • Hi Marius,

    It stated like this:

    "node": "^8.11.3".

  • Sorry for the late response. The shouldn't be a secret "trick" the stop and the "debugger" keyword/breakpoint.

    Are you sure your application passes this breakpoint at all? And did you open the ssh tunnel with this command:

    cf ssh -N -T -L 9229:127.0.0.1:9229 <APP NAME>

    Regards,

    Marius

  • Yes, I did open SSH tunnel, and yes, my app passes all explicit break-points in Chrome. My workaround is this:

    I created a small function (breakPoint) which throws and catches an exception and then turned on flag "Pause on caught exceptions" in Chrome. And then I insert the function at the points of interest - the debugger stops at the exception and then I am able to do step-by-step debugging.

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 17, 2018 at 07:52 PM

    It appears that the problem was in Chrome itself or more likely in the interface between node inspector and Chrome. Starting from Chrome version 71 breakpoints work again as expected.

    Add comment
    10|10000 characters needed characters exceeded