Can't take heap snapshot with chrome inspector for nodejs

5/15/2020

I run my nodejs 8.9.4 app (which is not a server) in a remote Kubernetes cluster with node --inspect=0.0.0.0:9229 app.js. I then port-forward 9229 on my machine. Finally, I access to chrome inspector and I can see my source code. I tried to run with --inspect-brk and I successfuly debugged my app. But I can't take heap snapshot: the button is disabled. I can't understand why. Disabled take snapshot button

-- Antoine
heap-memory
kubernetes
node.js
portforwarding
remote-debugging

1 Answer

5/20/2020

My advice is to :

  1. Update chrome to latest version and relaunched it (also it is good to download Chrome Canary )

  2. Restart node

  3. Open chrome://inspect and added localhost: port number -9229 update connection in chrome.

Take a look: debugging-nodejs, memory-leaks-nodejs.

-- MaggieO
Source: StackOverflow