Search code examples
node.jsdebuggingwebstormpm2

Node.js Debugger ends as soon as it is attached


I'm currently using WebStorm as IDE and my project uses pm2 as process manager. The structure of my ecosystem is the following:

module.exports = {
  name: 'myProject',
  cwd: __dirname,
  script: 'npm',
  args: 'run start:debug',
};

which executes

"start:debug": "nodemon --config nodemon-debug.json"

As soon as the project starts, the terminal throws:

Debugger listening on ws://127.0.0.1:9229/24bd6549-1601-4b0d-9e36-495765176abc
For help, see: https://nodejs.org/en/docs/inspector

I then press the Debug button in WebStorm with the following configuration:

enter image description here

After that the terminal shows this and the project starts without debugger:

Debugger listening on ws://127.0.0.1:9229/24bd6549-1601-4b0d-9e36-495765176abc
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger ending on ws://127.0.0.1:9229/24bd6549-1601-4b0d-9e36-495765176abc
For help, see: https://nodejs.org/en/docs/inspector

My node version:

nvm current -> v14.20.1

Yesterday it worked fine, today I turned on my PC and it is broken, nothing on my environment has changed that I'm aware of.


Solution

  • It turns out the last version of WebStorm, 2022.3.3, broke the WebStorm debugger, I had to go back to version 2022.3.2.